Templating Principles

This is the Directual syntax for dealing with object fields 📜

To work with data in scenarios and filters, you can use Templating. Directual's Templating system is based on the {{ mustache }} library, with some useful add-ons to the basic technology.

Interface in the video is a legacy edition one

Basic templating principle

To use the value of a field, we type its system name in double curly braces: {{field_system_name}}. To fetch the property value of a linked object, type the field-link followed by a dot and the system name of the linked object {{field_type_of_link.linked_object_field}}.

Inputs for templating

There are two types of input fields for templating. The first is a smart select:

Note, that you can nest fields of linked objects like {{book_author.name}}, where 'book_author' is a field type of link. However, this doesn't work for arrayLinks! To work with arrayLink fields, use the Link scenario step.

The second is a text area field. This field has an option to evaluate value as a JavaScript expression (coding mode).

This field also has a smart field inputs option. When it's ON, you can choose fields directly in the text, and typing "{{" will activate the smart inline select. Turn it off if needed.

Use expression testing to check the result of templating.

Last updated