Using variable tags for mapping fields

A variable tag is a label that you can use to retrieve the current data value in the record definition. It allows you to personalise the message in the actions (email, API, custom plugin) you set in the watcher. When the watcher is executed the variable tags are replaced by values from the record.

Guidelines for using variable tags

  • Variable tags can be set only to retrieve values for the specific record definition for which the watcher is created
  • Field names used in the variable tags are case-sensitive
  • If the field name is written incorrectly or does not exist, or the record does not have a value for a field, nothing will be displayed
  • You can use all field types as a variable tag. The value displayed is the last value listed for that field in the record
  • The following variable tags can be referenced:
    {{record.fields.<fieldname>}}: Displays the field name of the record 
    {{record.id}}: Displays the record ID

List of supported variable tags

The following table lists the supported variable tags:

Variable TagsPurpose
{{record.id}}Prints the ID
{{record.fields.flag}}Print the boolean value
{{record.fields.\"Field with spaces\"}}Escape spaces in field names
{{\"{{record.fields.escaped}}\"}}

Allows you to print the value as it is

The "{{" string is not supported within "{{" "}}" tokens

{{for element in record.fields.\"a list\"}}
	Element: {{element}}
{{end}}

or

{{for index, value in record.fields.userID}}
	{{index}}:{{value}}
{{end}}
Prints all the selected options in the select multiple fields
{{for key, element in record.fields.\"a map\"}}Prints all the values in the one to many views 
{if record.fields.description == "description"}}
    "match"
{{end}}
{{if record.fields.description == "description"}}
    "match"
{{else}}
    "does not match"
{{end}}
{{if record.fields.description == "description"}}
    "match"
{{elseif record.fields.descrption == "other"}}
    "match something else"
{{else}}
    "does not match"	
{{end}}
Print a field value if a certain condition is true (else / elseif are supported)

{{for index, element in record.fields."Inner Join"}}
  {{for key, value in element}}
    key: {{key}}<br />
    value: {{value}}<br />
  {{end}}
{{end}}

When you create a watcher for a view, using this syntax you can iterate over a collection (a list) or a map (which is one-to-many).

Examples

Email Setting 

For example, you can add variable tags in the body of an email:

API Setting

For example, you can add variable tags when making an API call: