•••
 
Documentation   /   Reference: syntax   /   Variables
 
 

Variables

 

A variable is a named value written in double curly braces. Variables work in templates, in workflow directives and in emails.

Syntax

{{variable_name}}
{{variable_name|Fallback text}}
{{variable_name|}}
{{document_alias:variable_name}}
Form Output
{{variable_name}} The value. If there's no value, the field's ---default_value, otherwise a blank line (____________).
{{variable_name|Fallback text}} The value, or the fallback text if there's no value.
{{variable_name|}} The value, or nothing at all if there's no value.
{{document_alias:variable_name}} In workflows: a variable from the document created or fetched by the item with that ID or alias.

Variable names use letters, numbers and underscores. They're case-sensitive.

A number 0 counts as a value. An empty string doesn't.

Important

A variable with no value and no fallback text is "broken". A document containing a broken variable can't be locked. Give optional variables fallback text, even if it's empty: {{variable_name|}}.

Types

Variables hold a string, an integer, a decimal (float) or a list.

List variables

A list holds several values. Internally the values are separated by [|], for example Ann[|]Ben[|]Cat. Lists come from repeating sections, multi-row data sources and values passed in that format.

Syntax Output
{{list_name}} All the values, in raw list format
{{list_name|Fallback}} All the values, or the fallback text
{{list_name:0}}, {{list_name:1}}, ... One value, by position. The first is 0. Blank values keep their position.
{{list_name:num_rows}} The number of rows, including blank ones (at least 1)
{{list_name:count}} The number of rows with a value (0 if none)
{{list_name:sum}} The total of the numeric values. Only set when at least one value is a number.

Values separated by [,] instead, such as the choices from a multi-select field, are shown as a bulleted list.

To repeat text for every value in a list, use Repeating sections.

Predefined variables

Some variables are built in and can't be overwritten:

Examples

{{company_name}}
{{company_name|Your company}}
{{offer:salary}}
{{shareholder_name:0}} and {{shareholder_name:count|0}} others