Skip to content

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 ​

SymbolMeaning
>>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

json
"conditionals": {
  "7": "TYPE_OF_HOUSE == 'APARTMENT' >> ROOM_COUNT"
}

If TYPE_OF_HOUSE equals 'APARTMENT', show the ROOM_COUNT field.

json
"8": "AGE > 18 >> EMAIL"

If AGE is greater than 18, show the EMAIL field.

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

json
"3": "land_use == 'Vacant and Undeveloped' >> property_structure && roof_type && num_rooms_units"

If land_use is 'Vacant and Undeveloped', the rule applies to property_structure, roof_type and num_rooms_units.

Set Logic (Auto-Assignment) ​

Automatically set a field's value when a condition is met.

Syntax: CONDITION => TARGET_FIELD = 'VALUE'

json
"conditionals": {
  "4": "BUILDING_NUMBER < 20 => TYPE_OF_BUILDING = 'ABANDONED'"
}

If BUILDING_NUMBER is less than 20, set TYPE_OF_BUILDING to 'ABANDONED'.

Complex Logic ​

Multiple Conditions (AND / OR) ​

Combine conditions using && (AND) or || (OR).

json
"6": "(BUILDING_EST <= 5 && BUILDING_COLOR == 'CREAM') => TYPE_OF_BUILDING = 'NEW'"

If BUILDING_EST is ≤ 5 and BUILDING_COLOR is 'CREAM', set TYPE_OF_BUILDING to 'NEW'.

json
"9": "(INCOME >= 50000 && EMPLOYMENT_STATUS != 'UNEMPLOYED') >> LOAN_ELIGIBILITY"

If INCOME ≥ 50,000 and EMPLOYMENT_STATUS is not 'UNEMPLOYED', show the LOAN_ELIGIBILITY field.

Array Membership ​

Check if a field's value is one of several options using an array literal.

json
"5": "(BUILDING_NAME == ['CALIFORNIA', 'SILICON VALLEY'] || BUILDING_NUMBER == 23.9) >> TYPE_OF_BUILDING"

If BUILDING_NAME is either 'CALIFORNIA' or 'SILICON VALLEY', or BUILDING_NUMBER equals 23.9, show TYPE_OF_BUILDING.

Action Chaining ​

Trigger multiple actions from a single condition using && between actions.

Syntax: CONDITION >> FIELD_A && => FIELD_B 'VALUE'

json
"5": "... >> TYPE_OF_BUILDING && => BUILDING_COLOR 'GREEN'"

If the condition is met: show TYPE_OF_BUILDING and set BUILDING_COLOR to '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.

json
// 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.

json
// Field definition
{ "key": "type_of_house", ... }

// Conditional — key must match exactly
"7": "type_of_house == 'APARTMENT' >> room_count"