Using Answer Option Logic, you can conditionally show answer options in compatible questions based on the rule(s) you set up. For example, you might want to remove the sign up date for a course once the date has passed.
Set Up An Answer Option Logic Rule
In this example, the below condition will only display the answer option May 1 if the current date is less than or equal to 2018-04-30. Handy!
- Edit your question.
- Click the pencil icon to the right of the answer option you wish to set up logic on and go to the Logic tab.
- Set up the conditions for displaying this answer option under Option Logic Rule.
- First, select a question from the previous page (or system variable such as date) that will be used in the IF part of the rule. In the case of a grid question, you will choose a specific row of the grid to use.
- Select the operator that will be used to evaluate the question. After you select your question, the system will apply the recommended operator for the question type you selected. For example, if the question you selected has preset answers, such as a Radio Button question, SurveyGizmo will switch to the operator "is one of the following answers" along with a list of the possible answers from your selected question:
- Finally enter the value or values that are required to complete the rule.
- Click Done and Save Question.
Answer Option Logic Workaround
Certain question types cannot be used as a source for answer option logic. One example of this is a Drag & Drop Ranking question. If you want to show/hide answer options in a follow-up question based on whether or not they were selected in the ranking (or other incompatible) question, use the below workaround.
- In our example, we ask our respondents to rank their preferred support channels in order of preference (the respondent is asked to rank their top three out of a possible six).
- We then want to ask a follow-up Checkbox question to see which of the ranked methods the respondent has used in the past month. We only want to include the ranked items in the list of answer options.
Since the Drag & Drop Ranking cannot be used as a direct source for answer option logic in the Checkbox question, we have to feed the ranked items into a Hidden Value so that we can use them to trigger answer options in the Checkbox.
- Once we have created our Drag & Drop Ranking question, we add a page directly after this question and set this page to auto-submit. This ensures that the page is not presented to a survey respondent.
- On this new page, we add a Hidden Value action. It's good practice to give this hidden value a meaningful title such as 'capture answers from ranking question'. The Hidden Value will be used to capture the answers from the ranking question on the previous page.
- Within the Hidden Value, we use the Select a Merge Code tool, to insert the merge code for the Question Answer of our source question. The Hidden Value will now capture all of the ranked items from our Drag & Drop as a comma separated list (ex. Social Media,Live Chat,Phone).
- Now, we can edit our follow-up Checkbox question (this question must be on a page after the auto-submitted page). Remember, our follow-up question must have all of the same answer options as our initial ranking question.
- Next, we edit the first answer option in our Checkbox question and click on the Logic tab. For example, the first answer option in our Checkbox question is Social Media. We only want to show this option in the checkbox question if it was ranked in the ranking question.
- From the Select a Condition dropdown, we cannot choose our ranking question. Instead, we must choose the Hidden Value from our auto-submitted page. Remember, the Hidden Value captures a comma separated list of the items that were ranked in our initial question.
- Because the ranked items are passed into the Hidden Value as a list, we must use the contains operator to evaluate whether a piece of text is in the list.
- Last, we must type in the text of the answer option exactly as it appears in the both the initial and follow-up questions.
- Our finished answer option logic condition looks at our Hidden Value and evaluates whether the answer option that should be shown is contained in the list that was captured by the Hidden Value. If the answer option is in the list, it will be shown in the Checkbox question.
- We repeat this process for each answer option in our Checkbox question.
See this in action in our Example Survey!
Compatibility
Answer option logic is not compatible with the below piping features. Learn more about Alternatives to Piping.
Compatible Questions
The answer options in the below questions can be conditionally displayed based on questions on previous pages.
The rows of the below questions can be conditionally displayed based on questions on the same page.
— Mike.cordeiro on 08/27/2020
@Shopee6: Thank you for reaching out to our help page!
With logic, the operators to logic conditions must exist on a page that is found prior to the ones that the logic conditions drive. To have Logic fire properly, the project must collect information that will determine what will happen on that page, based on previous answers. Regrettably there is not a workaround to have this function as you described it.
I hope this helps clarify.
Mike
Technical Writer
SurveyGizmo Learning and Development
— Shopee6 on 08/26/2020
The condition drop down in the option logic rule page is only up until page 6 of the survey then shows system data, geo tracking data, etc. My survey has several pages and I want to base the option logic on one of the latter pages. Is there a workaround for this?
Admin
— Dave Domagalski on 04/26/2019
@Chantah: Thank you for your question!
The best option for this is to have your yes/no question followed by a separate text response question.
You can then add 'question logic' to the text response question to only show it when the answer to the yes/no question is 'no'.
Here are the steps for setting up Question Logic:
https://help.surveygizmo.com/help/setup-question-logic
I hope this helps!
David
Technical Writer
SurveyGizmo Customer Experience
— Chantah on 04/26/2019
Hello, is there a way to hide a text response on a yes/no question if the answer is yes? In other words, I would like to add logic to an "if no, please explain text box" response. I only want it to show if they respond yes.
Admin
— Bri Hillmer on 08/03/2018
@MSR: The workaround in this article is for showing and hiding answer options based on a Drag & Drop ranking question not an entire question.
Logic on an overall question requires custom scripting. If you'd like to try your hand at this the following tutorial covers how to show/hide pages based on a ranking question. You can repurpose it to show/hide a question.
https://help.surveygizmo.com/help/drag-and-drop-show-when
I hope this helps!
Bri Hillmer
Documentation Coordinator
SurveyGizmo Customer Experience Team
— MSR on 08/03/2018
Hi there, I am trying to use display logic on a question based on options selected on a previous question that has Drag & drop ranking. I created the hidden page, hidden value as you had suggested. However the logic isn't working. I want another question to show up only if they had drag & dropped one particular option. Can you help with this? Thanks.
Admin
— Bri Hillmer on 07/19/2016
@JKolodner@newlweaders.org: There is not a way to set up answer option logic in bulk I am sorry to say. I think this is a great idea; I will report this to our customer experience team as a possible future improvement!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Extra on 07/19/2016
I have hundreds of answer options in my question and I would like to set option logic on each answer. Is there a batch process by which I can adjust the option logic without having to go into each answer choice individually?
Admin
— Bri Hillmer on 01/13/2016
@JA: Hi there! You are looking for a feature we call Option Piping. Check out the below tutorial and let us know if you have further questions about getting this set up!
http://help.surveygizmo.com/help/article/link/option-piping
I hope this helps!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— JA on 01/13/2016
I'd like to have the options of a question be populated by the selections made in a previous question. For instance, say I ask in Question 1, "What are your favorite cities?" and I gave a list of 10 cities with checkboxes. In Question 2, I'd like to ask, "Which of the cities you selected is your MOST favorite?" with radio button answers. I'd like the options of Question 2 to be the cities that the user checked in Question 1. Any ideas?
Admin
— Bri Hillmer on 08/27/2015
@Joe: I have just the tutorial for you:
https://help.surveygizmo.com/help/article/link/provide-immediate-correct-or-incorrect-feedback
You might also want to check out our quiz score tutorials as well to get a better understanding of how they work:
https://help.surveygizmo.com/help/article/link/quizzes
I hope this helps!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Joe.pistell@dealer.com on 08/27/2015
Hi! I'm creating a test & I need help. After each answer, I'd like to display the correct answer. At the end of the test, I'd like to make available a summary of the questions & answers. Question Types are %Percent and Continuous Sum. Scoring the results is not a high priority, I'm trying to make an interactive teaching experience. Thoughts?
Admin
— Bri Hillmer on 08/24/2015
@Eric: You would definitely need custom scripting to achieve this. This is honestly beyond the scope of my scripting abilities but I'm guessing this function might get you what you need:
http://script.surveygizmo.com/help/article/link/sgapipipematrixrows
If not, check out the rest of the site for scripting functions that might achieve what you are looking for:
http://script.surveygizmo.com/help/
I hope this helps!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Eric on 08/24/2015
Quick question related to the comments and content here. I am trying to pipe in answer options to a table of drop down and custom tables so that only certain rows will show based on answer that were previously given. I know this is possible with the question types listed way above, but wondering if there was a workaround for the question types I mentioned. Can't figure it out off-hand with the javascript examples given on your other pages. Thanks in advance for any help you can give!
Admin
— Bri Hillmer on 07/14/2015
@Rivera: Thanks so much for adding your workaround! I'll be sure to pass this along to our development team for discussion for future improvements!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Iris on 07/14/2015
@Rita: My work around for this issue is to do like Bri suggested and add an additional question, but opt to not number the additional question so the user feels like the additional options are in the same questions. This would definitely be a valuable function for SurveyGizmo to implement.
Admin
— Bri Hillmer on 07/08/2015
@Rita: Thanks for taking a look at our documentation! We do not have the functionality you describe. Could you perhaps follow up with a second question if a certain option is selected?
Alternatively, this is something that could be achieved with a little JavaScript. If you have someone on your team that is fluent with JavaScript they might be able to build this for you. Here is our scripting documentation if you want to try your hand at this:
http://script.surveygizmo.com/help
Another idea would be to check out one of the websites below. These websites have developers available that can build these features for you.
www.odesk.com
www.rentacoder.com
www.guru.com
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Rita on 07/08/2015
I know you can show/hide answer options based on answers to earlier questions, but can you show/hide options within the same question? For example, in a checkbox question, I'd like additional checkboxes to appear when the respondent checks a particular box?