form logicconditional

Conditional Logic

Show or hide fields dynamically based on the values of other fields.

Overview

Conditional Logic lets you define rules that control whether a field is visible or hidden based on the values entered in other fields. This makes your forms dynamic and responsive — respondents only see questions that are relevant to their previous answers, resulting in a faster and less confusing experience.

Rules are evaluated client-side in real time as the user types or selects values. Hidden fields are excluded from validation — a required field that is currently hidden will not block form submission.

Rule Structure

Each field has an optional logic object with an action ("show" or "hide") and an array of conditions:

"logic": {
  "action": "show",
  "match": "all",
  "conditions": [
    {
      "field": "employment_status",
      "operator": "equals",
      "value": "employed"
    }
  ]
}

Operators

PropertyTypeDefaultDescription
equalsField value exactly equals the specified value.
not_equalsField value does not equal the specified value.
containsField value (string) contains the specified substring.
not_containsField value does not contain the substring.
greater_thanNumeric field value is greater than the specified number.
less_thanNumeric field value is less than the specified number.
is_emptyField has no value (empty string, null, or undefined).
is_not_emptyField has any value.
inField value is one of an array of values.

Combining Rules

Use the match property to control how multiple conditions combine:

  • all — all conditions must be true (AND logic)
  • any — at least one condition must be true (OR logic)

JSON Schema

{
  "type": "text",
  "label": "Company Name",
  "name": "company_name",
  "required": true,
  "logic": {
    "action": "show",
    "match": "any",
    "conditions": [
      { "field": "employment_status", "operator": "equals", "value": "full_time" },
      { "field": "employment_status", "operator": "equals", "value": "part_time" }
    ]
  }
}