Uppercase
To display data field value in uppercase, use following expression.
{% uppercase({dataFieldName}) %}
Lowercase
To display data field value in lowercase, use following expression.
{% lowercase({dataFieldName}) %}
Capitalize
Uppercase the first character of each word in a string.
{% capitalize({dataFieldName}) %}
Sum
It is possible to calculate sum of table column using following code.
{% sum({line_items::amount}) %}
Sumproduct
The sumproduct function multiplies the corresponding items in the arrays and returns the sum of the results.
{% sumproduct({line_items::amount},{line_items::price}, {line_items::anotherColumn}) %}
Average
It is possible to calculate average of table column using following code.
{% avg({line_items::amount}) %}
Use "Number" formatting when creating calculations or using sum, average, sumproduct functions.
Count
It is possible to count number of items in list.
{% count({line_items}) > 3 ? 'More than three' : 'Less than three' %}
Empty
The empty(value) function checks if field has value.
{% empty({dataField}) ? 'No value' : 'Field has value' %}
Join
The join(delimiter, array) function concatenates field values with specified separator. Last arguments is always used as the separator.
{% join(";", {field1}, {field2}, {field3}, ..., {fieldN}) %}
{% join(";", [{field1}, {field2}, {field3}, ..., {fieldN}]) %}

Split
The split(delimiter, string) function allows to split string into an array.
{% split("_", "Some_string") %} => ["Some", "string"]
Date
Format date value. NB! You need to use the Date formatter.
{% date({dateString}, {timezone}, {addDays}, {outputFormat}, {inputFormat}) %}
Examples of the function "Date":
Display current time
{% date('now') %}
Specify timezone
{% date({dateValue}, 'UTC') %}
Specify output format
{% date({dateValue}, 'UTC', 0, 'd/m/Y') %}
Specify output and input format
{% date({dateValue}, 'UTC', 0, 'd/m/Y', 'm/d/Y') %}

Datetime
Format datetime value. NB! You need to use the Date formatter.
{% datetime({datetimeString}, {timezone}, {addDays}, {outputFormat}, {inputFormat}) %}
Examples of the function "Datetime":
Display current time
{% datetime('now') %}
Specify timezone
{% datetime({dateValue}, 'UTC') %}
Specify output format
{% datetime({dateValue}, 'UTC', 0, 'd/m/Y H:i:s') %}
Specify output and input format
{% datetime({dateValue}, 'UTC', 0, 'd/m/Y H:i:', 'm/d/Y H:i:') %}

When using the T separator in a date format you need to escape it like this Y-m-d\THH:mm:ss

Max
Returns maximum value of list of elements or separate field values.
{% max({line_items::quantity}) %}
or
{% max({dataField1}, {dataField2}, ..., {dataFieldN}) %}
Min
Returns minimum value of list of elements or separate field values.
{% min({line_items::quantity}) %}
or
{% min({dataField1}, {dataField2}, ..., {dataFieldN}) %}
Iterate list of elements (array map)
Iterates over list of elements and executes expression for each element. Returns new list.
{% iterate({line_items}, '{quantity}*{price}') %}
Collect unique values from list
Collects unique values from and counts them. Returns new list with following structure:
[{"value": "Value", "count": 3, "raw_value": "Value"}, {"value": "Value 2", "count": 1, "raw_value": "Value 2"}]
{% collect_unique_values({array}, {array_of_values_to_exclude}, {expression_to_execute_for_each_item}) %}

Flatten list
Flattens list.
{% flatten(iterate({orders}, "{line_items}")) %}
JSON decode
Decode JSON string to use in an expression.
{% json_decode('{"key": "value"}', true) %}
Was this article helpful?
Cancel
Thank you!