Conditional forms: building question logic that stays readable and maintainable
Conditional forms should make life easier for respondents, yet the logic behind them often turns into a tangle nobody dares touch. Here is a six-step method to keep every question justified and your form easy to evolve.

On this page
- Why conditional logic turns into a maze
- Step 1: Start from the data you need
- Step 2: Map the decision tree
- Step 3: Name conditions like business rules
- Step 4: Limit nesting and think in blocks
- Step 5: Test paths, not just questions
- Step 6: Evolve without breaking everything
- How Thingsform fits into this approach
- Pre-launch checklist
A conditional form promises a shorter experience: each respondent only sees the questions that apply to them. After a few rounds of changes, though, the logic often becomes a tangle of rules that nobody wants to touch. A condition added in a hurry hides an essential question, a rarely used path leads to a dead end, and the data you collect stops adding up.
The good news: this is less a tooling problem than a method problem. Here is a six-step approach to make sure every question only appears when it's useful, while keeping the form easy to change.
Why conditional logic turns into a maze
Three causes come up almost every time:
- Conditions are added one question at a time, with no overall view. Each rule makes sense on its own, but the combination no longer does.
- They rely on fragile labels. If a rule depends on the exact wording of an answer option, the slightest rewording can break it without anyone noticing.
- Nobody knows which paths actually exist, so nobody tests them all.
Each of the following steps addresses one of these causes.
Step 1: Start from the data you need
Before writing a single question, list the information you need to collect and, for each item, the situation in which it's useful. Take a quote request as an example:
| Data | Useful when | Required? |
|---|---|---|
| Customer type | Always | Yes |
| Company registration number | The customer is a business | Yes |
| Service address | The work takes place on site | Yes |
| Access constraints | The work takes place on site | No |
| Contact details | Always | Yes |
This table becomes the justification for every question. If you can't fill in the "Useful when" column for a question, you have two options: either it's useful to everyone and is always shown, or it's useful to no one and you can remove it.
Step 2: Map the decision tree
Next, identify your pivot questions: the ones whose answers determine what comes next. In our example there are two: customer type and where the work takes place.
Draw the tree, on paper or in a diagramming tool. Nodes are pivot questions, branches are their answers, and leaves are the blocks of questions to display. A few ground rules:
- Put pivot questions early. Respondents understand more quickly why they're seeing a given question.
- Bring branches back together into a common trunk (contact details, consent, confirmation). A form that keeps splitting without ever rejoining is hard to maintain.
- Keep the tree on one page. If it spills over, you probably have two separate forms that should be split.
Step 3: Name conditions like business rules
A condition written as "if Q3 = option 2" will be unreadable three months from now. Instead, give each condition a name that reflects a business reality: is_business, on_site_service, budget_above_threshold.
Pick a simple convention and stick to it:
- a state phrased as a statement that is either true or false;
- lowercase with underscores, no cryptic abbreviations;
- one concept per name.
Record these conditions in a shared dictionary: name, one-sentence definition, source question, and the questions or blocks that depend on it. This document lets you reword a label without fear of breaking a rule, and shows you immediately what removing a question will affect.
Step 4: Limit nesting and think in blocks
The more conditions are nested, the more fragile the form becomes. Some safeguards:
- Two to three levels of nesting at most. Beyond that, split or simplify.
- Apply conditions to blocks rather than individual questions. A single
on_site_servicerule that shows an "Address and access" block beats four identical rules spread across four questions. - Replace compound conditions with derived ones. Rather than repeating "A and (B or not C)" in several places, define a named condition that carries that meaning and reuse it.
- Check required questions that can be hidden. A required question that can be hidden is a classic cause of blocked submissions or missing data.
Step 5: Test paths, not just questions
Testing each question in isolation isn't enough: the problems lie in the combinations. List the possible paths based on the answers to your pivot questions. With two pivots of two answers each, you get four paths; with three pivots, up to eight, some of which may be impossible in practice.
Build a test matrix:
| Path | Pivot answers | Expected questions | Result |
|---|---|---|---|
| P1 | Individual, remote | Contact details only | Pass |
| P2 | Business, on site | Registration number, address, access, contact details | Needs fixing |
For each path, check three things: no dead ends, no orphan questions (shown for no reason), and consistent answers at the end, for instance no company registration number entered for an individual. Also have the rarer paths tested by people who didn't build the form: they're the ones who find the blind spots.
Finally, rerun the matrix after every change. It's your regression test.
Step 6: Evolve without breaking everything
A form is a living thing. To keep it maintainable:
- Every new question starts as a row in the Step 1 table.
- Every removal goes through the condition dictionary, so you can spot dependencies.
- Keep a short change log: date, change, reason.
- Regularly review questions that are rarely shown. A branch that almost nobody takes deserves a second look.
How Thingsform fits into this approach
Thingsform forms are built on this principle: they adapt, and a question only appears when it's useful. Thingsform's Submissions module follows the same adaptive-form logic.
The method described here, however, doesn't depend on any particular tool: it's what ensures every condition has a reason to exist. Whatever your setup, reviewing a sample of responses after each change is a good way to confirm that your paths are producing the data you expect.
Pre-launch checklist
- Every question has a "Useful when" justification.
- Pivot questions come early and the tree fits on one page.
- Every condition has a business name and is listed in the dictionary.
- Nesting doesn't go beyond three levels.
- No required question can be hidden without a check.
- Every path in the matrix has been tested, including the rarest ones.
From reading to doing
Build your first form in minutes. No credit card.
Keep reading

How to Change a Live Online Form Without Breaking Your Response History

Usable Data from the First Keystroke: Choosing the Right Field Types and Response Formats
