Using Display Logic in Surveys

Display logic, sometimes referred to as “branching” or “skip” logic, refers to adding parameters to a survey page or question to determine whether or not they will appear. This is usually based on a participant’s response to a previous question in the survey, but can also be conditioned on other factors, such as global variable value.

It will be important to note the Question ID for questions on which you wish to condition display logic. The Question ID is the first field visible when editing a question, and must be unique for each question within a survey. W2H automatically populates the Question ID field on any survey with question1, question2, question3, etc. However, you can set these names to be whatever you want/whatever will make analysis easier. Just remember to use the correct Question ID between the {curly brackets} in the display logic of subsequent questions.

 Instructions

To add display logic to a survey question:

  1. Click the blue “Edit” link above the question you want to show/hide

  2. Open the gray drop-down panel labeled “Logic”

  3. Type your expression into the text field. Your expression represents the conditions under which you want the question to display (ergo the “Visible if” text above the field).

 

Some common expressions used in display logic:

  • {question1} = ‘Yes’ This question will display only if the participant answered Yes to question1

  • {question1} >= 5 This question will display only if the participant’s answer to question1 was numeric and greater than/equal to 5

  • {question1} > 5 AND {question1} <=10 This question will display only if the participant’s answer to question1 was numeric and falls between 6 and 11

  • {question1} < 5 OR {question1} > 15 This question will display only if the participant’s answer to question1 was numeric and does not fall between 5 and 15

  • {question1} notempty This question will display only if an answer is entered for question1

  • {{@points}} <= 10 This question will display only if the participant has a value of 10 or less in their {{@points}} global variable

  • {question1} contains (5) This question will display only if the participant’s answer a checkbox-type question (i.e., a question that can have multiple answers selected) with an answer coded 5.

 

For more help with creating display logic, feel free to reach out to your implementation lead.