Conditional logic lets you structure your WorkForm so that certain follow-up questions appear based on a submitter's previous answers. It is an essential feature for creating more in-depth surveys or questionnaires.
Asking the right questions at the right time, now that is what we call magic! ✨
What is conditional logic?
Conditional logic in your questions allows you to consider what follow-up questions and information might be relevant once a submitter has answered a specific question in your Workform. This setting enables you, as the form creator, to display questions on the WorkForm only if the submitter's answers in a previous question meet a certain condition.
If a question contains conditional logic, you will see the conditional logic icon appear in the top right-hand corner of the question in your form builder.
Conditional questions with AI
For a quick and easy WorkForm building experience, you can use AI to generate a form and include conditional logic in the same flow. Describe what you’re collecting and when follow-up questions should appear, then review and fine-tune the logic in the form builder.
1 Click the + icon in the left-hand pane, select Form, and then choose New Form.
2 Describe the purpose of your form and the conditional logic you want to include.
For example:
“Create a customer feedback form. If the customer selects ‘Support issue,’ show a follow-up question asking for their ticket number. If they select ‘Product feedback,’ show a long text question for detailed comments.”
3 Click Generate preview to review the draft form.
Review the preview to ensure the defining question includes the correct answer options, and that each follow-up question appears only when the intended option is selected. If changes are needed, use the text box in the left-hand panel to tell AI what to adjust, then regenerate the preview.
4 Click Create form.
After it’s created, click Edit form in the top right-hand corner to open the form builder. From here, you can open the Logic panel under any question, select + Add logic, and refine or expand your conditional logic.
Setting up conditional logic manually
You can also add conditional questions manually by clicking on the Edit form button in the top right side of your screen. Click on the question in your form, and select the Logic button.
In the example below, we will examine an order form for a book supplier. Our defining question is a Single-select question: "What is the purpose of your purchase?" Once you have added the question, input the options the submitter can choose from in each of the option blocks.
Order requests sent to the book supplier are open to several different customers. Submitters can then choose an option from the drop-down list. Based on their choice, they will be redirected to another question using conditional logic. We will use two of these options to see how to build conditional logic around them.
- Option 1:
If a submitter selects the first option, "Personal purchase", from the dropdown list, they will be redirected to another question asking them for further details. To set this up, add a new question to the form, such as a Text question, and input the new question you wish to ask.
After adding the new question, click on the “Logic” icon below it. In the "Logic" panel on the right, click “+ Add logic,” then “Select question.” From the drop-down list, choose the question that defines the logic, and the option that leads to it.
Following our example, this would be “What is the purpose of your purchase?” followed by "Personal Purchase.”
The conditional logic asks, If the answer to the defining question was 'Option 1,' then display this question. When the submitter fills out the form, if they select 'Option 1,' the conditional question will appear.
- Option 2:
Following the same process above for Option 1, you can set a different follow-up question if the submitter selects a different option, such as Option 2. For example, if Option 2 is "Members Club", the conditional question could be set up as a Numbers question asking for the membership number.
Once set up, when the submitter chooses a different option in the defining question, its corresponding conditional question will appear. For example, "Members Club" will trigger the "Please provide us with your membership number" question.
Multi-layered conditional logic
You can add multiple conditions by configuring conditional logic for different questions, allowing each answer to trigger its own follow-up question. Additionally, you can apply multiple logic rules to the same question, so that it will appear if the submitter answers any of several previous questions.
- Multiple conditional logic- different questions
Below is a mind map showing the conditional logic flow for a customer support feedback form. The answer chosen in the first Single-select question will send the submitter to a specific flow of questions. Within that particular flow, there are other questions that contain new conditional logic.
For example, in the above mind map, in the green flow, if the submitter's answer is "No" to the question "Would you like us to contact you about your experience?", show them the question "Do you have feedback from your experience?"
These questions will only be present in the form for that particular flow, not, for instance, in the purple flow.
- Multiple conditional logic- same question
To direct submitters to a specific question based on previous answers, add additional logic that includes both questions. Click the "+Add logic" button in conditional settings, and choose the additional question and answer that leads to your "show if" question.
The additional logic works on "or" statements, allowing multiple rules to trigger a question. For example, if the question "Would you like us to contact you about your experience?" is "No, thank you," OR if "Which of these services did you use?" is "Live call with agent," then show the feedback question.
You can use the form below to see multiple conditional logic behaviors based on answers to the questions "Which of these services did you use?" and "Would you like us to contact you about your experience?":
Broken conditional logic
If you have set up conditional logic on your WorkForm that is not supported, the conditional logic icon will appear in red in the top right corner of your question, and a tooltip will display inside the logic builder explaining why the logic is broken.
For example, conditional logic is set so that if the submitter selects "Personal purchase," they're prompted with "We would love to hear why you've chosen this book!" However, "Personal purchase" is hidden as an option in the previous question.
To fix the error, make the suggested changes in the tooltip to either "unhide" the question or choose another available option for the conditional logic.
If you have any questions, please reach out to our team right here. We’re available 24/7 and happy to help.