Flow Forms Docs Flow Forms Docs

Conditional Logic

On this page 11

Conditional logic hides a field until an earlier answer makes it relevant. A form that would otherwise ask everyone everything instead asks each person only what applies to them, which makes it shorter and easier to finish.

In Flow Forms, the logic lives in named, reusable rules. A rule watches one or more fields, and any number of fields can be attached to it: they are visible only while the rule is true. Build the rule once - "Payment type is equal to Check" - and attach every check-related field to it.

Building a Rule

  1. In the form builder, open the More menu in the header and click Rules manager (or pick Create Rule from a field's context menu to start from that field).2. In the Rules modal, click + to create a new rule.
  2. On the Conditions tab, add one or more clauses: the form element to watch, the comparison, the value, and - from the second clause on - an and/or connective. Click Save Condition.
  3. On the Available Elements tab, pick the fields this rule should reveal.

The modal summarizes each rule as If ... then show ..., which is exactly how it behaves: the attached fields are hidden until the rule is met.

Building a Rule From the Field

In a field's editor, Visibility under Logic & validation reads Always shown or the rule that decides it. Click + Condition (or Edit condition) to build the same rules without opening the Rules modal:

  • Pick options - choose the field to watch, choose any of or none of, and tick the values. One trip for "show this when Hire Type is any of these five".
  • Build conditions - add as many clauses as the rule needs, each with its own field, comparison, and value, joined by and/or. This says anything the Rules modal can say.
  • Use an existing rule instead - attach the field to a rule that already exists, leaving its conditions alone.

A new rule names itself from what you picked - "Hire Type is Certified", or "Hire Type != Extra-Duty and Stipend > 500" when you build conditions. Type over the name to call it something else, or clear the box to go back to the suggestion. A rule that already exists keeps its name, because renaming it renames it everywhere it is used.

Rules are shared, so the modal names the other fields a rule controls. Tick Apply only to this element to give this one field its own copy instead of changing visibility for all of them.

How and/or Read Together

Every and clause has to hold, and any single or clause makes the rule true on its own - so "Hire Type is equal to Certified and Stipend is greater than 500, or Rush is not empty" shows the field to certified hires above 500, and to anyone marked rush. The summary under the clauses spells out how the rule reads before you save it.

Comparisons

Comparison Matches when the watched field
is equal to Exactly matches the value
is not equal to Is anything other than the value
is greater than Is numerically above the value
is greater than or equal to Is numerically at or above the value
is less than Is numerically below the value
is less than or equal to Is numerically at or below the value
contains Contains the value somewhere in its text
does not contain Does not contain the value anywhere in its text
is empty Has no value
is not empty Has any value at all

is empty and is not empty are the two that take no comparison value; the box for it disappears when you pick either.

A note on checkboxes: a checkbox holds every option the respondent ticked, so comparisons check each ticked option. is equal to "Blue" is true when Blue is among the choices, whatever else is ticked alongside it - and is not equal to "Blue" is false the moment Blue is ticked. Reach for contains when writing checkbox rules; it says what you mean.

What Can Be Watched

Rules watch fields that hold a fill-out value. Content, Group, File Upload, and Signature fields cannot trigger a rule - though they can all be shown or hidden by one. One boundary to know: a field inside a repeating group can only control other fields in its own group.

What to Use It For

Asking Follow-Up Questions

Keep the detail out of sight until it is needed. If "Do you have allergies?" is answered Yes, show the field asking which ones. If payment type is Check, show the check number field.

Branching

Send different people down different paths. A form serving several kinds of respondent can ask each group its own set of questions, and skip the sections that do not apply. Because one rule can reveal many fields, a whole branch is usually a single rule.

Varying What Is Required

A field only has to be filled in when it is showing, so a condition can make a question mandatory in some circumstances and absent in others. Ask for a phone number only on urgent requests, or for supporting documentation only above a certain amount.

Tips

  • Keep each rule simple. Several straightforward rules are easier to follow later than one intricate one.
  • Name rules for what they mean ("Is paying by check"), not what they compare.
  • Fill the form in yourself along every path, including the ones that only some respondents reach.
  • When a field appears partway through, its help text should explain why it is being asked.
  • Do not hide anything a respondent needs to see behind a condition they might not meet.