Conditional logic forms guide: if answer = X, show field Y
Conditional logic shows, hides, or skips form fields based on earlier answers — so each person only sees what's relevant to them. The core rule is 'if answer = X, show field Y'. For example, if 'Are you a current customer?' = Yes, show the account-number field; if No, skip it. You can also jump people to a later question or straight to the end. Below are concrete examples, the common patterns, and the pitfalls that trip people up.
Conditional logic (also called branching or skip logic) makes a form adapt to the person filling it out. Instead of showing everyone every possible field, you show fields only when an earlier answer makes them relevant. The result is shorter, smarter forms that don't ask retirees about their employer or solo registrants about their guest's meal choice. This guide explains the building blocks, gives concrete examples, and flags the mistakes that quietly break logic.
How does conditional logic work?
Every rule has the same shape: a condition based on an answer, and an action that fires when the condition is true.
- Condition: 'if [question] [operator] [value]' — for example, 'if Country = United States'.
- Action: show a field, hide a field, jump to a later question, or jump to the end.
- Combine conditions with AND/OR — 'if Role = Manager AND Team size > 10, show the budget question'.
Tools like Formkii support show/hide and jump-to-question or jump-to-end actions, with conditions combined using AND/OR — enough to build most real-world branching.
Concrete 'if X, show Y' examples
| If this answer... | ...do this |
|---|---|
| 'Are you a current customer?' = Yes | Show 'Account number' |
| 'Are you a current customer?' = No | Skip account fields, jump to 'How did you hear about us?' |
| 'Will you bring a guest?' = Yes | Show 'Guest name' and 'Guest meal choice' |
| 'Did you find what you needed?' = No | Show 'What were you looking for?' |
| 'Preferred contact method' = Phone | Show and require 'Phone number' |
| 'Are you 18 or older?' = No | Jump to an ending screen explaining the age requirement |
| 'Satisfaction rating' = 1 or 2 | Show 'What went wrong?' (long text) |
| 'Satisfaction rating' = 4 or 5 | Show 'Would you leave us a review?' with a link |
| 'Job type' = Full-time | Show salary and benefits questions; hide them for Volunteer |
| 'Do you have dietary restrictions?' = Yes | Show the dietary checkboxes |
Common branching patterns
1. The qualifier gate
A yes/no question at the top decides whether the rest of the form even applies. 'Are you 18 or older?' = No jumps straight to an ending screen. 'Are you hiring in the US?' = No ends a sales form early. This screens out people who'd waste their time and yours.
2. The detail reveal
Show a follow-up field only when the answer calls for it. 'Other' in a dropdown reveals a 'Please specify' text field. 'Yes, I had an issue' reveals a description box. The form stays short for everyone who doesn't need the extra field.
3. The satisfaction split
Route happy and unhappy respondents differently. A low rating shows 'What went wrong, and how can we fix it?' A high rating shows 'Would you share a quick review?' with a link. One form, two purposes — recovery and advocacy.
4. The persona path
A 'Which best describes you?' question (Student / Teacher / Parent, or Buyer / Seller) sends each persona down a tailored set of questions and hides the irrelevant ones. Everyone gets a form that feels built for them.
5. The custom ending
Different answers lead to different ending screens. A qualified lead sees 'We'll be in touch within one business day' with a calendar link; an unqualified one sees a helpful resource instead. Formkii supports different endings based on answers.
Sketch your logic as a simple flowchart before building — boxes for questions, arrows for branches. Five minutes on paper catches dead ends and contradictory rules that are painful to debug once the form is live.
What are the common conditional logic pitfalls?
- Orphaned required fields: a field is required but hidden by logic for some people, so they can never submit. Make sure hidden fields aren't required for the people who don't see them.
- Contradictory rules: two rules fight — one shows a field, another hides it — and the outcome is unpredictable.
- Forgetting the 'else' path: you handle 'Yes' but never decide what happens on 'No', leaving people stuck or seeing the wrong thing.
- Logic that references a question placed after it: a rule can only depend on answers the person has already given.
- Dead ends: a branch leads nowhere and the person can't reach the submit button.
- Over-branching: so many paths that the form is impossible to test or maintain. Keep it to the branches that genuinely matter.
- Not testing every path: each branch needs to be walked end to end, including the qualifier 'No' that should bounce people out.
How to test conditional logic
- 1List every possible path through the form (each combination of branching answers).
- 2Walk each path as a real respondent would, on a phone as well as desktop.
- 3Confirm hidden fields never block submission for the people who don't see them.
- 4Check every ending screen and jump lands where you intended.
- 5Try the edge answers — 'Other', the lowest rating, the qualifier 'No' — not just the happy path.
- 6Submit a test response down each path and confirm the data lands cleanly in your results.
Conditional logic checklist
- Every rule reads as 'if answer = X, do Y' and references an earlier question.
- No field is both required and hidden for the same person.
- Every question has a defined path for all of its answers, including 'No' and 'Other'.
- No two rules contradict each other.
- Every branch reaches a submit or an ending screen — no dead ends.
- Every path has been walked and test-submitted on mobile and desktop.
Frequently asked questions
What is conditional logic in a form?
Conditional logic shows, hides, or skips fields based on a person's earlier answers, so each respondent only sees what's relevant to them. The basic rule is 'if answer = X, show field Y'. It's also called branching or skip logic, and it keeps forms short and personalized.
Can you give an example of conditional logic?
A classic example: if 'Will you bring a guest?' = Yes, show the 'Guest name' and 'Guest meal choice' fields; if No, skip them. Another: if a satisfaction rating is 1 or 2, show 'What went wrong?', and if it's 4 or 5, show 'Would you leave a review?'.
What's the most common mistake with form logic?
Making a field both required and hidden for the same person, which means they can never submit because the form is waiting on an answer they were never shown. The fix is to ensure hidden fields aren't required for the people who don't see them, and to test every branch end to end.
Does conditional logic make forms shorter?
Effectively, yes. The form may contain many fields in total, but each person only sees the ones relevant to their answers, so it feels short and tailored. That's why logic-driven forms tend to have better completion than a single form showing every possible field to everyone.