Skip to content

Expression Syntax

Expressions are strings used by properties such as visibleIf, enableIf, requiredIf, defaultValueExpression, setValueExpression, choicesVisibleIf, validators, and calculated values.

Use curly braces around question or calculated value names.

{
"visibleIf": "{hasPets} = true"
}
  • 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
{
"type": "comment",
"name": "details",
"title": "Tell us more",
"visibleIf": "{needsFollowUp} = true"
}
{
"type": "text",
"name": "email",
"title": "Email",
"inputType": "email",
"requiredIf": "{contactMethod} = 'email'"
}
{
"name": "total",
"expression": "{quantity} * {unitPrice}"
}
{
"type": "text",
"name": "dueDate",
"inputType": "date",
"defaultValueExpression": "today(7)"
}