Additional helpers
Concatenation
To concatenate two or more strings into a single string, use the {{concat "<string 1> " ... " <string n>"}}
helper. Example:
{{#each inputValues}}
{{field type="input" name=(concat "field_" this)}}
{{/each}}
Object operations
To get the key value from an object, use the {{get <object> "<key>"}
helper. Example:
{{get inputValuesObj "key"}}
Logical operations and comparisons
Logical operations and comparison operations return either true
or false
.
- AND:
{{and "a" … "n"}}
, - OR:
{{or "a" … "n"}}
, - Negation:
{{not "a"}
.
To compare numeric values, use the helpers:
- Greater than:
{{gt "a" "b"}}
, - Greater than or equal to
{{gte "a" "b"}}
, - Less than:
{{lt "a" "b"}}
, - Less than or equal to:
{{lte "a" "b"}}
, - Equal to:
{{equal "a" "b"}}
.Note. The{{equal}}
helper lets you compare values of any data type.
Recording output data field values in JSON
The values of multiple components can be written to the output data field in JSON format.
To do this, specify the output data field in the name
attribute of the component and add a unique ID separated by a dot.
For example, the values of the two text input fields are written as JSON objects in the result
output data field.
{{field type="input" name="result.input1"}}
{{field type="input" name="result.input2"}}
The TSV file with responses will contain the following in the
result
column:{result {"input1": "<performer's response", "input2": "performer's response>"}}