Loading

Show and Hide Rules

A rule says which field appears, and under what condition.

Where to find it

Architect Panel → Forms:

  • Dynamic Add Fields — the definitions, then View Fields on a row
  • Conditional Forms — show and hide rules
  • Line Item Builders — the builders, then View Line Fields on a row

One condition per rule where you can

A rule testing three things is a rule that is hard to reason about when a field does not appear. Simple rules are easier to write, easier to read and much easier to debug.

Drive from a controlled field

A rule based on a list of defined options behaves predictably. One based on free text does not — a rule matching "Yes" fails on "yes", "Y" and "yes ".

If a field drives conditional logic, it should be a constrained choice.

Avoid chains

A field shown by a rule that depends on a field shown by another rule is a chain, and chains break in ways that are difficult to trace. Two levels is manageable; four is not.

Beware circular logic

Field A shown when B is answered, B shown when A is answered. Neither ever appears, and nothing tells you why.

Drawing the rules out on paper finds this in a minute; reading them does not.

Group rather than rule where you can

Showing a whole section on one condition is clearer than ten rules showing ten fields on the same condition — and when the condition changes, it is one edit.

Consider what a hidden required field does

A field that is required and hidden will either block submission invisibly or be skipped. Which one it does is a thing to establish before the form is live rather than after somebody cannot submit.

Write the rules down

In plain sentences, alongside the form. "If applicant type is Business, show the company section" is documentation the next person can check the configuration against.

Test by taking every path

Complete the form once per combination of deciding answers, and submit each. Reading the rules tells you what you meant; submitting tells you what happens.

Watch for rules left after a change

When a field is removed or an option renamed, rules referring to it remain. A rule matching an option that no longer exists never fires, and the field it controls never appears.

Worked example

A form uses three rules, each on a single constrained field, each showing a whole section. When an option was renamed, one section stopped appearing; the written rules made the cause obvious within a minute.

Recommendations

  • Drive rules from constrained choices, never free text.
  • Show sections rather than individual fields.
  • Avoid chains and check for circularity.
  • Re-check rules whenever a field or option changes.