Configure Rules
Rules are added in the rules section of a Questionnaire entry. They control navigation — when a user submits an answer, matching rules redirect the flow to a different question.
Rule types
Section titled “Rule types”rule-comparison (simple if/then)
Section titled “rule-comparison (simple if/then)”Use for straightforward single-condition checks.
This rule says: “When the user answers [question], if their answer [matches this condition], send them to [this screen].”
- Add a rule-comparison component in the rules section
- Fill in:
- questionId — The question this rule applies to (evaluated on submit)
- Operator (
if.op) — The type of check:equals,notEquals,greaterThan,lessThan,isIn,isNotIn,isDefined,isNotDefined,contains,notContains - Value type (
if.variable.type) —static(comparing to a fixed value) ordynamic(comparing to another question’s answer) - Value (
if.variable.value) — The value to compare against - Then go to (
outcome.goTo) — The questionId to jump to
Example: When the user answers the hasPet question, if their answer is “No”, send them to the blocker screen:
- questionId:
hasPet - Operator:
equals - Value type:
static(a fixed value) - Value:
false - Then go to:
noPetBlocker
rule-group-comparison (AND/OR)
Section titled “rule-group-comparison (AND/OR)”Use when you need to check multiple conditions together.
This rule says: “When the user answers [trigger question], if [all/any] of these conditions are true, send them to [this screen].”
- Add a rule-group-comparison component
- Set questionId — The trigger question
- Set if.condition —
AND(all must match) orOR(any must match) - In if.comparisons, add multiple entries to the list:
- Each entry has:
questionId, Operator (op), Value type (variable.type), Value (variable.value)
- Each entry has:
- Set Then go to (
outcome.goTo)
Example: When the user answers the pet type question, if pet type is DOG and pet age is over 10 years, send them to a special screen:
- if.condition:
AND - Comparison 1: questionId
petType, Operatorequals, ValueDOG - Comparison 2: questionId
petAge, OperatorgreaterThan, Value10
rule-date (age checks)
Section titled “rule-date (age checks)”Use for date-based logic like age verification.
This rule says: “When the user enters a date, if the calculated age [meets this condition], send them to [this screen].”
- Add a rule-date component
- Set questionId — The date question to evaluate
- Set Operator (
if.op) —lessThan,greaterThan, orequals - Set Value (
if.value) — The threshold (e.g.,18) - Set Check by (
if.granularity) —year,month, orday(most of the time you will useyear) - Set Then go to (
outcome.goTo)
Example: When the user enters their date of birth, if they are under 18 years old, send them to the age blocker:
- questionId:
dateOfBirth - Operator:
lessThan - Value:
18 - Check by:
year - Then go to:
ageBlocker
rule-always (unconditional)
Section titled “rule-always (unconditional)”Use as a fallback/catch-all at the end of a rule chain.
This rule says: “When the user answers [question], always send them to [this destination], no matter what they answered.”
- Add a rule-always component
- Set questionId — The trigger question
- Set Then go to (
outcome.goTo) — Where to always redirect
Example: After the last data-collection question, always jump to the quote page:
- questionId:
lastPreQuoteQuestion - Then go to:
quote
Best practices
Section titled “Best practices”- One path per rule — Each rule should handle one specific case. Use separate rules for separate paths.
- Order matters — Rules are evaluated top-to-bottom. Put specific rules first, general/fallback rules last.
- Avoid else with multiple rules — If you have multiple rules for the same question, do not use
elseon any rule except the last. Theelsefires immediately when theifis false, preventing later rules from being checked. - Use rule-always for defaults — Instead of
else, add arule-alwaysas the last rule for a question to handle the “everything else” case. - Test all paths — After adding rules, preview the questionnaire and walk through every possible answer path.
See also
Section titled “See also”- Rule Operators Reference – complete list of operators, value types, and rule structures
- Adding Conditional Rules – hands-on tutorial for adding rules to a questionnaire
- Rule Evaluation – detailed explanation of evaluation order, the “else” pitfall, and grouped conditions