Expression Syntax
Expressions are strings used by properties such as visibleIf, enableIf, requiredIf, defaultValueExpression, setValueExpression, choicesVisibleIf, validators, and calculated values.
Referencing Values
Section titled “Referencing Values”Use curly braces around question or calculated value names.
{ "visibleIf": "{hasPets} = true"}Common Operators
Section titled “Common Operators”- Equality:
{country} = 'AU' - Not equal:
{country} != 'AU' - Comparison:
{age} >= 18 - And:
{age} >= 18 and {country} = 'AU' - Or:
{contactMethod} = 'email' or {contactMethod} = 'phone' - Empty check:
{email} notempty
Common Patterns
Section titled “Common Patterns”Conditional question
Section titled “Conditional question”{ "type": "comment", "name": "details", "title": "Tell us more", "visibleIf": "{needsFollowUp} = true"}Required only when visible
Section titled “Required only when visible”{ "type": "text", "name": "email", "title": "Email", "inputType": "email", "requiredIf": "{contactMethod} = 'email'"}Calculated value
Section titled “Calculated value”{ "name": "total", "expression": "{quantity} * {unitPrice}"}Dynamic default
Section titled “Dynamic default”{ "type": "text", "name": "dueDate", "inputType": "date", "defaultValueExpression": "today(7)"}