Conditional Logic
Show or hide fields dynamically based on user input.
Conditional logic lets you create dynamic forms that adapt based on user input. Show or hide fields, pages, or sections based on the values of other fields.
How Conditional Logic Works
Each field can have conditional logic that determines when it’s visible:
- Define conditions based on other field values
- When conditions are met, the field is shown (or hidden)
- Conditions are evaluated in real-time as users fill out the form
Setting Up Conditional Logic
Add Conditional Logic to a Field
- Select a field in the builder
- Click the Logic tab in the field panel
- Click Add Condition
- Configure the condition
- Save
Condition Structure
Each condition has:
- Field: Which field to check
- Operator: How to compare
- Value: What to compare against
Example:
IF "country" EQUALS "United States" THEN show "state"
Condition Actions
Show When
The field is visible when conditions are met.
Use for fields that only apply in certain situations:
- State/province when country is selected
- Spouse information when married
- Additional options when feature is enabled
Hide When
The field is hidden when conditions are met.
Use for fields that should be hidden in certain situations:
- Skip questions based on previous answers
- Hide irrelevant options
Building Conditions
Simple Conditions
Single condition:
Show "phone" WHEN "contact_preference" = "call"
Multiple Conditions
Combine with AND/OR logic:
Show "shipping_address" WHEN:
"delivery_method" = "ship"
AND "country" = "United States"
Condition Groups
Group conditions for complex logic:
Show "discount_field" WHEN:
(
"customer_type" = "premium"
OR "order_total" > 1000
)
AND "promo_enabled" = true
Available Operators
Comparison Operators
| Operator | Description | Example |
|---|---|---|
eq (equals) | Exact match | name = “John” |
neq (not equals) | Not exact match | status ≠ “completed” |
gt (greater than) | Numeric comparison | age > 18 |
gte (greater or equal) | Numeric comparison | score >= 80 |
lt (less than) | Numeric comparison | quantity < 10 |
lte (less or equal) | Numeric comparison | price <= 100 |
Text Operators
| Operator | Description | Example |
|---|---|---|
contains | Contains substring | email contains “@gmail” |
not_contains | Doesn’t contain | name not contains “test” |
starts_with | Begins with | phone starts with “+1” |
ends_with | Ends with | email ends with “.edu” |
matches_pattern | Regex match | code matches ”^[A-Z]{3}$“ |
Value Operators
| Operator | Description | Example |
|---|---|---|
is_empty | Has no value | notes is empty |
is_not_empty | Has a value | email is not empty |
is_true | Boolean true | agree is true |
is_false | Boolean false | subscribe is false |
Length Operators
| Operator | Description | Example |
|---|---|---|
length_eq | Exact length | zip length = 5 |
length_neq | Not exact length | code length ≠ 3 |
length_gt | Longer than | message length > 100 |
length_lt | Shorter than | name length < 50 |
Field Compatibility
Which Fields Can Be Referenced
You can reference:
- Fields on the same page
- Fields on previous pages
- Non-repeatable fields from anywhere
- Sibling fields within the same repeatable group
Within Repeatable Groups
Inside a repeatable group:
- Reference sibling fields in the same instance
- Reference the current instance’s values
- Reference global (non-repeating) fields
Visibility Calculation
When Visibility Updates
- Immediately when referenced field values change
- On page load/navigation
- After workflow updates
Hidden Field Behavior
When a field is hidden:
- It’s not visible to the user
- Its value is preserved (unless cleared)
- It’s not validated
- It’s not required
Clearing Hidden Values
Optionally clear values when hidden:
- Enable “Clear when hidden” option
- Value is reset when conditions hide the field
- Useful for preventing stale data
Examples
Country-Based Address
Show "state" WHEN "country" = "United States"
Show "province" WHEN "country" = "Canada"
Show "county" WHEN "country" = "United Kingdom"
Employment Details
Show "employer_name" WHEN "employment_status" = "employed"
Show "school_name" WHEN "employment_status" = "student"
Show "retirement_date" WHEN "employment_status" = "retired"
Progressive Disclosure
Show "advanced_options" WHEN "show_advanced" = true
Within advanced_options:
Show "custom_domain" WHEN "use_custom_domain" = true
Show "api_key" WHEN "enable_api" = true
Best Practices
Keep It Simple
- Don’t over-complicate logic
- Use clear field names
- Document complex conditions
Test Thoroughly
- Test all condition combinations
- Check edge cases
- Verify on different devices
Consider User Experience
- Don’t hide too much initially
- Provide context for why fields appear
- Make logical groupings
Performance
- Complex conditions can slow forms
- Limit nested condition depth
- Consider breaking into pages