Question logic is a highly effective way to improve the flow of your questionnaire and tailor it to make it relevant to respondents. It allows you to specify which question to go to or go to the end of the questionnaire, based on the answer to a preceding question, quiz score, or contact data. Alternatively, you can decide to show or hide certain questions based on the criteria you set.
There are a few steps to create your logic, and you need to have a good understanding of how it all works. Here's what this guide will cover:
- How does question logic work?
- Add a new logic rule
- Write logic rule using answer on question criteria
- Write logic rule with other criteria
- What's next?
1 How does question logic work?
The way to build a logic rule is by first specifying your criteria (IF) and then specify what action should be taken (THEN).
Let us talk through the example displayed in the image below to make this clearer. IF the respondent chooses answer A, younger than 35, THEN they are asked a question for this group and afterwards continue with the rest of the questionnaire. IF the respondent chooses answer B, they are older than 35, THEN they are asked two questions and then continue with the questionnaire.
When you are building your rule, you can choose your criteria (IF) from any of the following items (or a combination of these items):
- Answer on question
- Response on intro field
- Custom score
- Quiz score
- Formula (Enterprise/ReportR)
When the criteria are matched, specify what action will be taken (THEN). The actions can be chosen from the following list:
- Skip to question
- Skip to end
- Hide questions (Professional & up)
- Hide answers (Enterprise/ReportR)
- Show following answers (Professional & up)
- Make question mandatory (Enterprise/ReportR)
- Add to formula (Enterprise/ReportR)
So, now you know the theory, let's see how to put it into practice. Have no fear, it's way more intuitive than you think! Let us dive right in...
2 Add a new logic rule
Click Create rule and you will now see the screen below. Look how you first specify your IF criteria, and THEN you specify what should happen.
Question Logic View
If you want to view the question logic in the questionnaire editor, toggle the question logic view button.
Once you've created your rules, when you return to the questionnaire editor, you'll see a description of the rule above each question, looking like this:
Rules are shown on the left if the question has a rule applied to it, for example, skip to this question if... (inbound)
Rules are shown on the right if a rule has been made for that question. (outbound)
Now let's see how to create the criteria...
3 Write the logic rule using 'answer on question' criteria
We'll go through in detail how to create your first rule, using the answer on question criteria. Read through this carefully to understand how the logic rules are built, and then if you want to use different criteria, check out the later section of this guide.
3.1 Build the IF part of the rule
Start by selecting the first choice: answer on question. This allows you to specify which question you want to be answered a certain way in order to activate the rule. Now you can choose the question you want to use for this rule. Any questions that are grayed out cannot be selected as the question format is not compatible with creating a logic rule.
Let's create a rule that is based on the answers to question 1. Whoever rated the service as 5 stars will skip to the end of the questionnaire. This way, anyone who was not totally satisfied will be shown an extra question asking for more details.
When you have selected answer on question, you have to specify when the rule should be applied. It can be applied if the answer is equal to a specific value, not equal to a specific value, greater than or many more options that you'll see on the drop-down menu.
If you want to create a few rules with the same criteria, why not save time and just click copy rule at the top of the logic box to duplicate what you've done? This way all the work you've done will be copied and you can simply make some minor changes for each rule rather than having to do everything from scratch for each rule. Neat!
If you're on the Professional, Enterprise, or ReportR plan, you'll see a purple circle with a + sign which allows you to add more rules. For example, skip to a certain question when 2 conditions are met.
Tip: If you have a multiple-choice question, you must add extra specifications to your conditions. For example, if you want the logic applied only when answer 1 is chosen, and not answers 2 and 3, the first part of the condition will state that answer must be equal to answer 1. Then click the + sign to add conditions (AND) that the answer should not be equal to answer 2 AND not equal to answer 3.
3.2 Define what happens THEN
Now it's time to specify what happens THEN. Click Select and you'll see the menu of possible options. If you choose skip to question, you'll then be able to select which question you want to send respondents to when the IF criteria is met.
4 Write logic rule with other criteria
Now you know the basics of creating a rule. Let's have a look at other ways you can create the IF criteria.
4.1 Custom/Quiz score
There are three types of custom/quiz scores you can use for the IF criteria:
- Custom/Quiz score on questionnaire - take a specific action depending on custom/quiz score received on all questions of the questionnaire
- Custom/Quiz score on question block - take a specific action depending on custom/quiz score received for a specified group of questions (question block)
- Custom/Quiz score on question - take a specific action depending on the custom/quiz score received for just a single question
Click the arrow to access the drop-down menu of options.
If you want the logic rule to be applied to the custom/quiz score received for a question block or specific question, you will be given the option to choose which question block or question.
Next, for all three types of quiz scores, you will be able to choose what the score should be, from a whole range of options including equal to, greater than, between and others - see the image below for the full list.
Once you have specified all the conditions for the IF criteria, now choose what action should be taken (THEN). For example, you might want respondents who score very high or very low on a certain question to skip to the end of the questionnaire.
One final way to build your IF criteria can be based on the contact data. This can be any of the following data: email, unique identifier, or personal ID.
For example, you may want to hide a question to a specific respondent, so if you have sent them a questionnaire with a personalized link (by email invitation with a customized link), you can make a rule that this respondent will not see a certain question.
You can build the rule in exactly the same way as we have seen so far. First specify your IF criteria, here it will be an email address contains a certain name, and then specify what happens THEN (skip to question number, skip to end, hide question, etc).
Click Apply to save the rule you've created. Make sure to also click save changes in your questionnaire - the apply for question logic doesn't count as a full save!
5 What's next?
- If you're on the Enterprise or ReportR plan, you can use question logic to add points to a formula. Use this handy combination to calculate scores, to keep a count (for example, how many times a respondent answered "yes" throughout the survey), or show different outcome screens for different formula results. Read all about using question logic to add to formula.
If you are building a quiz, question logic might be useful to show a screen immediately after answering a question, displaying whether the answer was right or wrong. Simply hide the Correct screen (Text-only question) if the answer is incorrect and vice versa.
Hide groups of questions when they are irrelevant to the respondent. Here's an example - when you are creating a general assessment for your organization and the respondent answers in an earlier question that they are a Digital Marketer, you can simply hide all questions that are not related to marketing.