Conditional Logic
The conditionals object defines rules that control form behavior dynamically. Each entry maps a unique numeric key to a logic string.
There are two types of conditional logic:
- Skip Logic (Visibility) — show or hide a field based on a condition
- Set Logic (Auto-Assignment) — automatically assign a value to a field based on a condition
Syntax Legend
| Symbol | Meaning |
|---|---|
>> | Show the target field if the condition is true |
=> | Set the target field's value if the condition is true |
== | Equals |
!= | Not equals |
< | Less than |
<= | Less than or equal to |
> | Greater than |
>= | Greater than or equal to |
&& | Logical AND |
|| | Logical OR |
&& (action) | Chain multiple actions together |
Skip Logic (Visibility)
Show a field only when a condition is met.
Syntax: CONDITION >> TARGET_FIELD_KEY
"conditionals": {
"7": "TYPE_OF_HOUSE == 'APARTMENT' >> ROOM_COUNT"
}If
TYPE_OF_HOUSEequals'APARTMENT', show theROOM_COUNTfield.
"8": "AGE > 18 >> EMAIL"If
AGEis greater than 18, show the
Multiple Target Fields
List several field keys after >>, separated by &&, to apply the rule to all of them.
Syntax: CONDITION >> FIELD_A && FIELD_B && FIELD_C
"3": "land_use == 'Vacant and Undeveloped' >> property_structure && roof_type && num_rooms_units"If
land_useis'Vacant and Undeveloped', the rule applies toproperty_structure,roof_typeandnum_rooms_units.
Set Logic (Auto-Assignment)
Automatically set a field's value when a condition is met.
Syntax: CONDITION => TARGET_FIELD = 'VALUE'
"conditionals": {
"4": "BUILDING_NUMBER < 20 => TYPE_OF_BUILDING = 'ABANDONED'"
}If
BUILDING_NUMBERis less than 20, setTYPE_OF_BUILDINGto'ABANDONED'.
Complex Logic
Multiple Conditions (AND / OR)
Combine conditions using && (AND) or || (OR).
"6": "(BUILDING_EST <= 5 && BUILDING_COLOR == 'CREAM') => TYPE_OF_BUILDING = 'NEW'"If
BUILDING_ESTis ≤ 5 andBUILDING_COLORis'CREAM', setTYPE_OF_BUILDINGto'NEW'.
"9": "(INCOME >= 50000 && EMPLOYMENT_STATUS != 'UNEMPLOYED') >> LOAN_ELIGIBILITY"If
INCOME≥ 50,000 andEMPLOYMENT_STATUSis not'UNEMPLOYED', show theLOAN_ELIGIBILITYfield.
Array Membership
Check if a field's value is one of several options using an array literal.
"5": "(BUILDING_NAME == ['CALIFORNIA', 'SILICON VALLEY'] || BUILDING_NUMBER == 23.9) >> TYPE_OF_BUILDING"If
BUILDING_NAMEis either'CALIFORNIA'or'SILICON VALLEY', orBUILDING_NUMBERequals23.9, showTYPE_OF_BUILDING.
Action Chaining
Trigger multiple actions from a single condition using && between actions.
Syntax: CONDITION >> FIELD_A && => FIELD_B 'VALUE'
"5": "... >> TYPE_OF_BUILDING && => BUILDING_COLOR 'GREEN'"If the condition is met: show
TYPE_OF_BUILDINGand setBUILDING_COLORto'GREEN'.
Grouped Choices
For a field with grouped choices, the group is stored under key and the option within it under sub_key. Test the group through key, and a specific option through sub_key.
// Any option in the Agricultural group
"4": "(land_use == 'Agricultural' || land_use == 'Transportation') >> roof_type"
// One specific option
"5": "detail_land_use == 'Open market / stalls' >> num_rooms_units"Compared values must match a group name (for key) or an option (for sub_key) exactly, including capitalization and spacing.
Key Matching
Field keys used in conditionals must exactly match the key defined in the fields array. Keys are case-sensitive.
// Field definition
{ "key": "type_of_house", ... }
// Conditional — key must match exactly
"7": "type_of_house == 'APARTMENT' >> room_count"