Functions in document templates
Functions can be used when automatically formatting documents using templates. Functions simplify how data is displayed in your documents. For example, you can use formulas to automatically display numbers as words or calculate order costs.
Formulas
To add a formula to a document, use the following syntax: %%%FORMULA%%%.
A FORMULA is an expression for calculating the value of a field, just like in a calculated field.
Example:
In the example above, data from the "Service" data tag is added to the formula using the corresponding variables. The two values are multiplied, and the result is the value of the total cost of a specific service or product. The TEXT() function formats the value as a human-readable text string.
Functions
All functions available in document template formulas: SUM() NUMBERASWORDS() FRACTIONALPART()
The SUM function
SUM() is a function that adds up all values obtained when calculating a formula. It is applied to each element of a multiplying variable.
For example, say you have a "Service" data tag and you want to calculate the total cost of all services in a document. You would use the following function:
SUM({{DataTag.Service.Cost}})