Skip to content

Configure Validations

Validations add client-side checks to question answers. When a validation fails, the user sees an error message and cannot proceed until they fix their input.

  1. Open a question in your questionnaire
  2. Find the validations array field
  3. Add an entry for each validation rule

Each validation entry has:

Field Purpose Example
op The comparison operator greaterThan, lessThan, equals
variable The value to compare against { type: "static", value: "2000-01-01" }
variableEqual (for range checks) Second bound { type: "static", value: "2026-12-31" }
message Error text shown to the user “Date must be after January 2000”

Ensure a date is within an acceptable range:

Field Value
op greaterThan
variable.type static
variable.value 2000-01-01
message Date must be after January 1, 2000

Add a second validation for the upper bound:

Field Value
op lessThan
variable.type static
variable.value 2026-12-31
message Date must be before December 31, 2026

Ensure a numeric input meets a minimum:

Field Value
op greaterThan
variable.type static
variable.value 0
message Value must be greater than zero

Ensure one date comes after another:

Field Value
op greaterThan
variable.type dynamic
variable.value coverageStartDate
message This date must be after your coverage start date
Feature Validations Rules
When evaluated Before the answer is accepted After the answer is submitted
Purpose Prevent invalid data entry Control navigation flow
User experience Error message on the current screen Redirect to a different question
Scope Single field Can reference multiple answers