Navigation (Branching) Rules
- Updated
In survey creation, it’s often helpful to be able to skip questions, show questions, or go to different questions based on the participant’s previous answers. For instance, in a survey about smoking, you may wish to skip most of the questions if the participant says they have never smoked.
There are three kinds of navigation rules. The first allows you to skip the current step based on the participant's previous answers. The second allows you to show the current step based on the participant's previous answers. The third allows you to control which step is next when the current step is completed.
Table of Contents
Skipping the Current Step
You can add a skip rule to any step. If the conditions are met, the survey will skip over that step and immediately go to the next one. To set up a skip rule:
- Select the step in the survey editor.
- Go to the Navigation tab.
- Under "Skip this step..." select either "Never" or "If a condition is met."
- Select a previous question, and the answer(s) that will cause the step to be skipped. Depending on the question type, you will be able to select specific values, or ranges like "is greater than...".
You can enter any number of conditions, and even combine and negate conditions using AND, OR, and NOT to create complex logic. See Compound Conditions below for more information.
Showing the Current Step
You can add a show rule to any step. If the conditions are met, the survey will show the step. To set up a show rule:
- Select the step in the survey editor.
- Go to the Navigation tab.
- Under "Show this step..." select either "Never" or "If a condition is met."
- Select a previous question, and the answer(s) that will cause the step to be shown. Similar to skipping a step, you may be able to select specific values, or ranges like "is greater than…” depending on the question type.
Controlling the Next Step
You can also select from several options of where to go when the step is completed:
- Go to the next step
- Go to a specific step
- Go to steps depending on previous answers
“Go to the next step” is the default for all steps and will send the participant to the next step in the sequence. “Go to a specific step” lets you choose a specific step to send the participant to.
“Go to steps depending on previous answers” lets you set up complex conditional logic to send them to steps depending on their answer to the current (or previous) questions.
To create a branching survey in the survey editor, go to the navigation tab for the step you would like to branch from.
When you’ve selected “Go to steps depending on previous answers” you will be presented with a button that allows you to add a navigation rule. Clicking the button displays the “Edit Navigation Rule” dialog.
You can then set up a condition. For instance, if the step “E_SMOKE
” has the answer “NO”, you can choose a step for the participant to go to if the condition is true—for instance, “INSTRUCTION_THANKYOU
.”
This will send the user to the “INSTRUCTION_THANKYOU
” step if the user has answered “NO” to the “E_SMOKE
” question.
The following table contains “finish steps” that will close a survey. These options are available when using branching logic or if “When the user completes this step…” is set to “Go to a specific step" or "Go to steps depending on previous answers". They will prompt a participant with “Done” instead of “Next”.
Target Step | Summary |
---|---|
Finish Survey -> Cancel | A target step that closes the survey after prompting the participant to select whether they wish to save or discard all previous responses. |
Finish Survey -> Cancel and Save | A target step that saves the participant’s responses from previous steps and closes the survey. If the participant returns to the survey at a later time, their saved answers will be pre-populated. |
Finish Survey -> Cancel and Discard | A target step that discards the participant’s responses from previous steps and closes the survey. |
Finish Survey -> Complete and Submit Results | A target step that closes the survey and submits the results. |
You can set up as many navigation rules as you want on a single step. The navigation rules will be evaluated in order until one evaluates to true. If none of the navigation rules evaluate to true, the user will be sent to the next step.
Compound Conditions
You are not restricted to a single conditional when editing a navigation rule. By clicking the “AND”, “OR” and “NOT” buttons you can combine or negate the various conditions.
Branching Based on Regular Expressions
Since a web view step can return complex data, you can use regular expressions (regex) to control branching based on whether the answer matches a certain string.
For example, if you have a web view step that returns some location data, you could create a navigation rule that branched to an instruction step if the web view data matched a particular location.
The system will compare the regex against the entire web view step answer. You must account for the answer data before and after your desired string in your regex. For example, .*Washington.*
will match "any text, followed by Washington, followed by any other text."
Was this article helpful?