Variable substitution

In field markdown, you can insert variables from the form model and from callback data using double curly bracket notation. Variable substitution works only when the field supports markdown:

  • For elements that have an Enable markdown toggle (the text element, tooltip element, and alert element), you must turn the toggle switch on.

  • For radio button element option Description fields, markdown is supported by default.

Note

You can use multiple variables in a single string.
If a referenced form model property is missing, an empty string is used.

Nested properties

Nested properties are supported. These are properties inside an object. For example, if $.user is an object, you can reference properties inside it using dot notation, such as {{ $.user.name }} or {{ $.user.data.name }}.

Example: Hello, {{ $.user.data.name }}.

Formatters

Formatters let you transform a variable value before it is displayed. For example, you can format a timestamp for the user locale, convert a size value to a specific unit, or convert an array to a comma-separated list.

Date presentation

  • {{ $.timeValue | toLocalTimeFormatDateTime }} - full timestamp converted to local time format

  • {{ $.timeValue | toLocalTimeFormatDate }} - date in local time format

  • {{ $.timeValue | toLocalTimeFormatTime }} - time in local time format

  • {{ $.timeValue | toISODateTime }} - show the date and time as is

  • {{ $.timeValue | toISODate }} - date in YYYY-MM-DD adjusted to local time

  • {{ $.timeValue | toISOTime }} - time in HH-mm-ss adjusted to local time

Size presentation

  • {{ $.sizeValue | toBytes }}

  • {{ $.sizeValue | toKBytes }}

  • {{ $.sizeValue | toMBytes }}

  • {{ $.sizeValue | toGBytes }}

Array presentation

  • {{ $.arrayValue | toList }} converts ["1", "far away", "land"] to 1, far away, land.

Variables from child forms

Values returned from a child form as output parameters can set or update values on the parent form model, and can be used as variables. For more information, see Child forms.

Examples

  • Hello, {{ $.full_name }}.

  • Computer {{ $.computer.name }} state has changed to OK

  • Last updated: {{ $.timeValue | toLocalTimeFormatDateTime }}

  • Free space: {{ $.sizeValue | toGBytes }}