Expressions let you add dynamic logic directly to your templates. Where a merge field outputs a raw value, an expression can transform it — formatting a date, calculating a total, checking whether a field is blank, or conditionally showing and hiding content.
Expressions use Jexl (JavaScript Expression Language) with a set of custom functions added by Doctavian for common document generation tasks.
{!$Expression}Expressions can be used inline in the template, as element parameter values, in Global Variables, and in Expression Fields on a Data Source.
Doctavian expressions are built on Jexl (JavaScript Expression Language) — standard Jexl expressions are fully compatible. You can test expressions in the free Jexl Playground before using them in your templates, keeping in mind that Doctavian's custom functions won't be available there.
Every field value inside an expression is treated as a string by default. Wrap values in a conversion function before performing type-specific operations:
{!$toDecimal(Invoice[0].TotalAmount) + 10}
{!$format(date(Invoice[0].DueDate), 'date', 'medium')}Doctavian expressions support five categories of functions:
The Expression Builder is available in the Add-in (Word, Excel) and Add-on (Google Docs, Sheets). It lets you browse functions by category, insert data fields from your connected Data Source, and preview the composed expression before inserting it into the template.
The Expressions Reference contains the complete function tables with signatures, return types, and invoice-based examples for every function.