Skip to content

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.

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].”

  1. Add a rule-comparison component in the rules section
  2. 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) or dynamic (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

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].”

  1. Add a rule-group-comparison component
  2. Set questionId — The trigger question
  3. Set if.conditionAND (all must match) or OR (any must match)
  4. In if.comparisons, add multiple entries to the list:
    • Each entry has: questionId, Operator (op), Value type (variable.type), Value (variable.value)
  5. 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, Operator equals, Value DOG
  • Comparison 2: questionId petAge, Operator greaterThan, Value 10

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].”

  1. Add a rule-date component
  2. Set questionId — The date question to evaluate
  3. Set Operator (if.op) — lessThan, greaterThan, or equals
  4. Set Value (if.value) — The threshold (e.g., 18)
  5. Set Check by (if.granularity) — year, month, or day (most of the time you will use year)
  6. 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

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.”

  1. Add a rule-always component
  2. Set questionId — The trigger question
  3. 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
  • 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 else on any rule except the last. The else fires immediately when the if is false, preventing later rules from being checked.
  • Use rule-always for defaults — Instead of else, add a rule-always as 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.