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.
How Quote-Page Rules Work
Section titled “How Quote-Page Rules Work”- Each Quote-Page V2 component has an optional
ruleGroupsfield — an array of rule group objects. - When the quote page renders, the rule engine evaluates every rule group against the user’s current answers.
- Based on the
resultType, the component is either hidden or disabled. - If
ruleGroupsis empty or absent, the component is always visible.
Rule Group
Section titled “Rule Group”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.
Result Types
Section titled “Result Types”| 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. |
Condition Logic
Section titled “Condition Logic”| 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 |
Rule Operators
Section titled “Rule Operators”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) |
Operators
Section titled “Operators”There are 11 operators, grouped by category.
Value Comparison
Section titled “Value Comparison”| Operator | Description | Example |
|---|---|---|
equals |
Answer exactly equals the value | { op: "equals", value: "premium" } |
notEquals |
Answer does not equal the value | { op: "notEquals", value: "basic" } |
Collection Comparison
Section titled “Collection Comparison”| 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" } |
Existence Check
Section titled “Existence Check”| Operator | Description | Example |
|---|---|---|
isDefined |
Answer is not null/undefined | { op: "isDefined" } |
isNotDefined |
Answer is null/undefined | { op: "isNotDefined" } |
Date Comparison
Section titled “Date Comparison”| Operator | Description |
|---|---|
dateDiff |
Date-based comparison. Requires the dateDiffValue field (see rule-date-diff below). |
Answer References
Section titled “Answer References”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.
Examples
Section titled “Examples”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" } ]}Override the footer for users over 65
Section titled “Override the footer for users over 65”{ "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.
Key Differences from Questionnaire Rules
Section titled “Key Differences from Questionnaire Rules”| 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 |
See also
Section titled “See also”- Configure Visibility Rules – step-by-step guide for adding rules to quote-page components
- Rule Operators Reference – questionnaire rule operators (for comparison)
- Quote-Page Architecture – how quote-page rules differ from questionnaire rules