Trigger Schema
Triggers run actions when an expression becomes true. Prefer simpler properties like visibleIf, enableIf, setValueIf, and setValueExpression unless a root-level trigger is specifically needed.
Common Trigger Types
Section titled “Common Trigger Types”setvalue— set a question valuecopyvalue— copy one question value to anotherskip— skip to another pagecomplete— complete the formrunexpression— calculate an expression and optionally store its result
Minimal Shape
Section titled “Minimal Shape”{ "type": "setvalue", "expression": "{sameAsBilling} = true", "setToName": "shippingAddress", "setValue": "Same as billing"}Properties
Section titled “Properties”- Type:
string - Required: Yes
Trigger type.
expression
Section titled “expression”- Type:
expression - Required: Yes
Boolean expression that activates the trigger.
setToName
Section titled “setToName”- Type:
string
Question or calculated value name to update.
setValue
Section titled “setValue”- Type:
value
Value assigned by a setvalue trigger.
fromName
Section titled “fromName”- Type:
string
Source question for a copyvalue trigger.
copyDisplayValue
Section titled “copyDisplayValue”- Type:
boolean
Copies the displayed text instead of the stored value for a copyvalue trigger.
gotoName
Section titled “gotoName”- Type:
string
Page or question name used by skip-style triggers.
runExpression
Section titled “runExpression”- Type:
expression
Expression evaluated by a runexpression trigger. If setToName is provided, the result is stored there.
isVariable
Section titled “isVariable”- Type:
boolean
When true on a setvalue trigger, stores the value as a survey variable instead of a question answer.
Examples
Section titled “Examples”Complete Early
Section titled “Complete Early”{ "triggers": [ { "type": "complete", "expression": "{screenOut} = true" } ]}Copy an Answer
Section titled “Copy an Answer”{ "triggers": [ { "type": "copyvalue", "expression": "{sameAsBilling} = true", "fromName": "billingAddress", "setToName": "shippingAddress" } ]}Skip to a Follow-Up Question
Section titled “Skip to a Follow-Up Question”{ "triggers": [ { "type": "skip", "expression": "{hasIncident} = true", "gotoName": "incidentDetails" } ]}Run an Expression
Section titled “Run an Expression”{ "triggers": [ { "type": "runexpression", "expression": "{quantity} notempty and {unitPrice} notempty", "runExpression": "{quantity} * {unitPrice}", "setToName": "lineTotal" } ]}Generation Notes
Section titled “Generation Notes”- Prefer
visibleIf,enableIf,requiredIf,setValueIf,setValueExpression, andresetValueIffor local question behavior. - Use root triggers for survey-level actions: completing early, jumping focus, copying answers, or storing a computed result when an expression becomes true.
- Trigger
expressionis always the activation condition.runExpressionis the calculation performed by arunexpressiontrigger. - Use Completion Behavior for complete triggers and post-submit messages.