Skip to content

Quote-Page Rules

Quote-page rules are a separate rule system from questionnaire routing rules. They control the visibility and interactivity of individual quote-page components based on the user’s current questionnaire answers.

  1. Each Quote-Page V2 component has an optional ruleGroups field — an array of rule group objects.
  2. When the quote page renders, the rule engine evaluates every rule group against the user’s current answers.
  3. Based on the resultType, the component is either hidden or disabled.
  4. If ruleGroups is empty or absent, the component is always visible.

Each entry in the ruleGroups array has two fields:

Field Type Required Default Description
rules tuple Yes A tuple of [condition, comparisons] where condition is "AND" or "OR" and comparisons is an array of rule objects
resultType enum Yes HIDDEN What happens when the group evaluates to true: HIDDEN or DISABLED

The rules tuple structure is ["AND" | "OR", Rule[]] — the first element is the logical combinator and the second is the array of individual conditions.

Value Behavior
HIDDEN The component is completely removed from the page. The user cannot see it.
DISABLED The component is visible but greyed out and non-interactive. The user can see it but cannot interact with it.
Value Behavior
AND All comparisons must be true for the group to match
OR At least one comparison must be true for the group to match

Each individual rule in the comparisons array has the following fields:

Field Type Required Description
op enum Yes The operator (see below)
variable object Yes Identifies the answer to evaluate (see below)

The variable object structure depends on the operator:

For standard operators (equals, notEquals, isIn, etc.):

Field Type Description
key string[] Path to the answer value (e.g., ["plan"] or ["address", "country"])
value any The comparison value

For dateDiff operator:

Field Type Description
key string[] Path to the date answer
type enum Time unit: "day", "month", or "year"
value number Threshold value
dir enum Direction: "gt" (greater than) or "lt" (less than). Default: "gt"
comparisonKey string[] Path to another answer to compare against (optional)
comparisonDate string Fixed date string to compare against (optional)

There are 11 operators, grouped by category.

Operator Description Example
equals Answer exactly equals the value { op: "equals", value: "premium" }
notEquals Answer does not equal the value { op: "notEquals", value: "basic" }
Operator Description Example
isIn Answer is in the provided array { op: "isIn", value: ["DE", "AT"] }
notIsIn Answer is not in the provided array { op: "notIsIn", value: ["US", "UK"] }
contains Answer array contains the value { op: "contains", value: "dental" }
notContains Answer array does not contain the value { op: "notContains", value: "dental" }
hasElements Answer is a non-empty array { op: "hasElements" }
hasNoElements Answer is an empty array or undefined { op: "hasNoElements" }
Operator Description Example
isDefined Answer is not null/undefined { op: "isDefined" }
isNotDefined Answer is null/undefined { op: "isNotDefined" }
Operator Description
dateDiff Date-based comparison. Requires the dateDiffValue field (see rule-date-diff below).

Rules reference questionnaire answers through the variable.key array. The key is a path to the answer value in the questionnaire state.

  • Top-level answers: Use a single-element array (e.g., ["plan"])
  • Nested answers: Use a multi-element array (e.g., ["address", "country"])

Quote-page rules evaluate against the same answers the user provided in earlier questionnaire steps. When mergeQuoteOptionsToQuestionnaire is enabled, customization option values are also available for rule evaluation.


All examples below show the ruleGroups array as it appears in the runtime format.

Hide an addon if the user selected a basic plan

Section titled “Hide an addon if the user selected a basic plan”
{
"ruleGroups": [
{
"rules": ["AND", [
{ "op": "equals", "variable": { "key": ["plan"], "value": "basic" } }
]],
"resultType": "HIDDEN"
}
]
}

Disable a customization for specific countries

Section titled “Disable a customization for specific countries”
{
"ruleGroups": [
{
"rules": ["OR", [
{ "op": "isIn", "variable": { "key": ["country"], "value": ["US", "UK", "CA"] } }
]],
"resultType": "DISABLED"
}
]
}
{
"ruleGroups": [
{
"rules": ["AND", [
{
"op": "dateDiff",
"variable": {
"key": ["dateOfBirth"],
"type": "year",
"value": 65,
"dir": "gt"
}
}
]],
"resultType": "HIDDEN"
}
]
}

Attached to a footer-override component, this activates the override for users over 65.


Aspect Questionnaire Rules Quote-Page Rules
Purpose Determine the next question (routing) Control component visibility/interactivity
Result Routes to a question ID HIDDEN or DISABLED
Scope Per-question, evaluated on submit Per-component, evaluated on render
Operators 20+ including country/address-specific 11 general-purpose operators
Date handling rule-date component rule-date-diff component
Grouping rule-group-comparison ruleGroups array on each component