Forms · Glossary

What is conditional logic?

Conditional logic in a form changes what somebody sees based on what they have already answered. Say no to attending the dinner and the dietary question is skipped; say yes and it appears. Every person only meets the questions that apply to them, which shortens the form without removing anything the organiser needs.

Conditional logic is how a form of forty possible questions becomes a form of twelve actual ones. It is also how a form becomes impossible to test, if you let it grow without a map.

· Co-founder

5 min read · Published · Updated

Two ways forms apply it

Form tools implement conditional logic in one of two shapes. Show and hide logic keeps everyone on one page and reveals or removes a field when an earlier answer matches, which suits classic single page forms. Jump logic, also called skip or branch logic, works on forms that show one screen at a time: after each screen, a rule decides which screen comes next, so whole questions are passed over rather than hidden. The results look similar to the respondent. The difference is in how you build and test it, since show and hide works field by field while jump logic works as a route through the form.

What ships in this builder

Logic here is jump logic on conversational forms, set on a Logic tab that sits between Build and Add-Ons. Each question can carry rules. A rule holds one or more conditions, matched on all or any of them, and each condition compares an earlier answer: is, is not, is empty or is answered for choices; is more than and is less than for numbers; and contains for text. A matching rule either jumps to a chosen question or ends the form, and each question can also have a default target for when no rule matches, otherwise the form simply moves to the next question in order. Back follows the path the person actually took, the progress bar counts the screens visited against those still ahead, and Submit appears when a rule ends the form. Classic forms have no conditional logic, so a classic form shows every field to everyone.

A worked example

A conference registration asks five questions in order: name, email, days attending, coming to the dinner, dietary requirements. On the dinner question add one rule: if the answer is No, jump to the end of the form. A guest who answers Yes moves on to dietary requirements as normal, and a guest who answers No finishes one screen early, never seeing a question that does not apply. To test it, fill the form in twice, once down each path, and check both rows in the responses. The No row has an empty dietary cell, which here means not asked rather than skipped.

Where it goes wrong

Complexity compounds. Two rules are easy to hold in your head; six interacting rules produce paths nobody has ever walked, and the one that breaks is always the one a real person takes. Every branch multiplies the testing: four independent yes or no decisions give sixteen possible routes. Other common mistakes are a rule that jumps backwards and creates a loop, a rule that points at a question later deleted, which the builder flags as needing attention, and a required question placed on a path some people skip. Required is checked again for the whole form at submit, so anyone whose path jumps past it gets a submit error and cannot send their answers. Every question a rule can skip must be optional. If you cannot list the paths, you cannot claim the form works.

What it does to your data

Skipped questions produce empty cells in the export, and an empty cell is ambiguous: it can mean the person was not asked, or was asked and skipped it. If a question matters analytically, make the qualifying answer part of the same export so every empty cell can be explained, or ask the qualifying question in a way that lands in its own column. Otherwise the analysis turns into reconstructing who saw what.

Questions people ask

How many rules is too many for one form?

If you cannot draw every path on one sheet of paper, there are too many. Four independent decisions already give sixteen routes through the form. A useful discipline is to write down each route and fill in the form once per route before publishing, checking that every response lands in the export the way you expect it to.

Does conditional logic help completion rates?

It helps when it removes questions rather than adding them. A form that is visibly shorter for most people asks for less effort, and effort is what makes people give up. It does not help when rules keep adding follow up screens, which makes the form feel longer the more carefully somebody answers.

Is revealed content accessible?

It can be. On a one page form, content revealed by an answer needs to be announced to assistive technology rather than silently inserted, and it should appear directly after the question that triggered it. On a one question per screen form, each new screen is a natural reading point, which avoids most of that problem.

Should I use logic or two separate forms?

Two forms are better when the paths share almost nothing, because each stays simple, testable and cleanly exported. Logic is better when the paths share most questions and differ in a few, since two near duplicate forms drift apart the first time somebody edits only one of them and forgets the other.

Can a rule check more than one earlier answer?

Yes. A rule can hold several conditions and match when all of them are true or when any of them is. That covers cases such as jumping to a partner section only when somebody is both attending and bringing a guest. Keep each rule readable in one sentence, and split anything longer into two rules.

What happens when no rule matches?

The form falls back to the question's default target if one is set, and otherwise moves to the next question in order. Setting a default is how you send everybody past a section unless a rule sends them in, which is often simpler than writing a rule for every answer that should skip it.

Make one with forms

The button opens the generator with this use case already described. Change the wording to match your own.

Create a form with OneCraft

Related questions

Sources

Written and checked by the OneCraft team. Last checked .