Skip to content
Conditional Logic

Form Logic

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:

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

Operators

PropertyTypeDefaultDescription
equals——Field value exactly equals the specified value.
not_equals——Field value does not equal the specified value.
contains——Field value (string) contains the specified substring.
not_contains——Field value does not contain the substring.
greater_than——Numeric field value is greater than the specified number.
less_than——Numeric field value is less than the specified number.
is_empty——Field has no value (empty string, null, or undefined).
is_not_empty——Field has any value.
in——Field 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

JSON
{
  "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" }
    ]
  }
}

Was this helpful?