Show if/Hide if logic is used to modify the visibility of a question or any subpart of it to respondents. It allows you to show or hide a question or answer if a responded selected a specific answer on another question.
To add Show if/Hide if logic, type the formula into the survey field using square brackets; [ ]. A formula will consist of a rule (in this case, show if or hide if) and a condition: a description of given answers or their combinations that should trigger the rule.
As you begin typing, possible rules and conditions will appear.
You can express a variety of conditions, illustrated in the following examples:
- [...Q1] if a question was shown to a respondent.
- [...Q3SQ1A1] if answer 1 on subquestion 1 on question 3 was selected.
- [...Q8R>=2] if two or more answers (or checkboxes) were selected on question 8.
- [...Q6SQ1P1] if subquestion 1 was dragged to the top position on question 6, a ranking question.
- [...Q1A1 and not Q1A2] if answer 1 was selected in the first question, but answer 2 was not.
You can also add several conditions in one rule by stringing them together with simple prepositions:
- [...Q1A1 or Q1A2] if one condition is satisfied OR another condition is satisfied.
- [...Q1A1 and Q1A2] if one condition is satisfied AND another condition is satisfied.
In addition, you can use regular parentheses to group conditions together. The parentheses in [Show if not (Q1A1 and Q1A2)] describe a situation where BOTH the first and second answers on Q1 were selected. Since there is "not" before the condition, the entire condition must be false. If it's false, the field will be shown.
Keep in mind that all "Show if" and "Hide if" rules starting with the same command must be formulated together within a field. Instead of typing [Show if not Q1A1] [Show if not Q1A2], you want to type [Show if not Q1A1 and not Q1A2], otherwise both rules may be ignored.
Finally, we allow several conditions isolated in parentheses to be strung together with OR or AND operations. For example:
- [...not (Q1A1 and Q1A2) or (not Q1A3 and not Q1A4)]
If you have any additional questions about Show if/Hide if logic, please reach out to firstname.lastname@example.org or click the chat bubble at the bottom right to start a conversation. We look forward to hearing from you!