Conditional logic in forms: a practical guide with rule examples
How show-if rules work, which conditions to use, how chained rules behave and how to test them, with examples for feedback, support and sign-up forms.
A show-if rule displays a question only when an earlier answer matches a condition (is, is not, contains, is answered, greater or less than). Rules can chain, hidden questions are never required, and you should test every path in preview before publishing.
Conditional logic (also called branching or skip logic) means a question is shown only when an earlier answer matches a condition. It is the simplest way to make a form shorter without losing information: every respondent answers the questions that apply to them and nothing else.
This guide explains how rules work in Branchform, which condition to pick for which kind of question, and how to test a form before you share it.
How a rule is built
Every question can have one rule with three parts:
- The earlier question the rule looks at.
- The condition: is, is not, contains, is answered, is not answered, greater than, or less than.
- The value to compare with (not needed for "is answered" and "is not answered").
Read aloud, a rule sounds like a sentence: "Show *What went wrong?* only if *How did we do?* is less than 3." That is the whole model; there is no flowchart to draw. The conditional logic help article shows where the rule editor is.
Choosing the right condition
| Question type | Good conditions | Example |
|---|---|---|
| Single choice | is, is not | Show "Order number" if "Topic" is *Existing order* |
| Multiple choice or text | contains | Show "Which integrations?" if "Tools you use" contains *Zapier* |
| Rating or number | greater than, less than | Show "What went wrong?" if rating is less than 3 |
| Optional question | is answered, is not answered | Show "Best time to call?" if "Phone" is answered |
A common mistake is using *is* on a rating when you mean a range. "Rating is 1" misses ratings of 2. Use *less than 3* instead.
What happens to hidden questions
Hidden questions are skipped completely:
- their required setting doesn't apply, so a hidden required question never blocks submission;
- any answer typed before the question was hidden is discarded, not saved;
- in the CSV export, the column for a hidden question is empty for that response.
This matters for data quality. If a respondent starts down one path and changes an earlier answer, you never get stray answers from the path they abandoned.
Chained rules
Rules can depend on questions that themselves have rules. If question B depends on A, and C depends on B, then hiding B also hides C. Chains are useful for drill-down forms:
- "Did you contact support?" (Yes / No)
- If *Yes*: "Was your problem solved?" (Yes / No)
- If *No*: "What is still not working?"
Keep chains short. Three levels are easy to reason about; seven are not, and they are hard to test.
When questions move or disappear
If you move or delete a question that a rule depends on, Branchform removes that rule and the dependent question becomes always visible. The editor tells you when this happens, so check the message after reorganising a form. Rules always look at earlier questions, which keeps forms from looping.
Four rule patterns worth copying
- Rating follow-up: show "What went wrong?" if rating is less than 3; show "Would you recommend us?" if rating is greater than 3.
- Other, please specify: show a text field if a choice question is *Other*.
- Routing: a first "What is this about?" question, then a separate set of questions for each answer.
- Consent-gated contact: show "Email" only if "Can we follow up?" is *Yes*. You then only store email addresses from people who agreed to be contacted.
The customer feedback survey template uses the first and last patterns together.
Testing a form before you share it
- Publish the form and open the share link in a private browser window.
- Walk every branch: one response per path. For a rating follow-up, submit a 1, a 3 and a 5.
- Change an earlier answer halfway through and confirm the follow-up questions disappear.
- Download the CSV and check the columns are filled where you expect and empty where questions were hidden.
- Delete the test responses so they don't skew your numbers.
When logic is the wrong tool
Logic is for showing and hiding questions. It doesn't calculate scores, send different emails per answer, or take payments. If you need those, export the CSV and do that step in the tool built for it. Keeping the form simple is usually the better trade.
Try Branchform free
Forms that adapt to every answer. Build with conditional logic, embed anywhere, export responses. The Free plan needs no card; you can export or delete your data any time.