Introduction to routing
Question routing is where respondents are only asked questions relevant to them when completing the questionnaire. Questions that are not relevant to them are skipped. You use Routing Rules to set up routing in a questionnaire.
There are three types of routing rules that can be used in a Snap questionnaire.
- Conditionally Ask Question
- Goto On Answer
- Goto After Question
A rule can either be added at the beginning of a question, within a question code or at the end of a question.
Routing can be hidden or displayed in any of the publication types, for example, a web questionnaire containing routing would ensure respondents only view the questions they are asked as long as Always is selected in the visible list box. This is located in the Routing Rules dialog. The 3 options available are:
Always – routing is always displayed on the questionnaire in all publication methods.
Never – routing is not shown on the questionnaire in any form of publication method.
Paper only – routing is shown on paper questionnaires, but not web surveys.
The routing rules dialog is displayed if you click on the Questionnaire window toolbar or right-click and select Routing Rules from the context menu. It displays all routing rules for the currently selected variables
|Routing Rules pane||Summary of all rules set on the currently selected variable|
|View only active fields||Check to display all available routing rules, whether used or not. Clear to display existing routing rules only|
|Open the New routing instruction dialog to create a new rule|
|Remove||Delete the selected routing rule|
|Details||Toggle the display of the Rule Details panel (different for each type of routing rule)|
|Type||Select type of routing rule to add from drop down list|
|On||Select answer code from drop-down list that a Goto On Answer applies to|
The following table explains where the rules of each type appear in a question and how they relate to other questions in the questionnaire.
|Routing Rule:||Appears in:||Question(s) referred to in ‘If’ condition:||Target ‘Goto’ question:|
|Conditionally ask question||Start of question text||Any question before the host||NA|
|Goto on answer||Code ‘Go to’||NA||Any question after the host or end of questionnaire|
|Goto after question||Anywhere in the footnote||Any question before the host or the host itself||Any question after the host or end of questionnaire or end of section|
If a question includes a combination of rules, each rule is treated in the order that it appears in the question. For example, if the first rule asked is a Conditionally Asked Question, only those who meet the condition are asked the question. If the next rule in the question is a Goto On Answer, those remaining respondents who match this rule move to their target question. Any remaining respondents are asked the next rule and this continues until the last rule has been asked. As each condition is met, the respondents are moved to their target question immediately.
Routing rules tutorial
The description of routing uses an example survey, Activate. The survey asks about membership in a leisure club. The example below shows the Activate questionnaire with routing applied.
- Existing members would be asked Q1, Q2 and Q5
- Non-members who are interested in joining would be asked Q1, Q3, Q4 and Q5
- Non-members with no interest in joining would be asked Q1, Q3 and Q5.
Routing rules are added to this questionnaire to ensure respondents are asked the relevant questions.
The Conditionally Ask Question rule is set up at the beginning of the question and is situated within the question text. Snap looks at the rule before the question is asked and the question is only asked if the conditions are met. If the conditions of the rule are not met, Snap skips this question and moves onto the next question.
- one condition is allowed per question
- the condition can reference more than one question
- the questions referenced must be previously asked question on the questionnaire
If you create a condition that will not work, such as referring to a later question, the rule is highlighted in red.
The Activate survey contains Q4 “Please give your name and address” This question only needs to be asked to respondents who ticked “Yes” to Q3 “Would you be interested in becoming a member here?”
In order to set up this scenario, you must create a routing rule within Q4 to identify who needs to be asked this question.
- Click anywhere within the question you wish to set routing on (here, in Q4 “Please give your name and address”).
- Right-click and select Routing Rules from the menu. You can also click on the Questionnaire window toolbar.
- Click Add to create a new routing rule. The example below shows that no routing rules have been set up for Q4 as yet.
- Select Conditionally Ask Question as the Type and click OK.
The Routing Rules dialog expands and fills with information. (You can also see this by clicking Details>> on the Routing Rules dialog and hide it by clicking Details<<.)
The cursor is located in the If box.
- Type your routing condition. In this example, “Q3=1”. The “1” refers to code 1 of Q3, which is the first answer “yes”. Further details on routing rules can be found in Routing rules expressions.
- Type ‘If ‘Yes’,‘ in the Text box. This text can be displayed on the questionnaire
- Select in which publication mode, if any, you would like the routing to be displayed from the Visible drop-down list.
- Click OK to save your rule.
The rule has been set up so:
- when the If condition is true (yes is ticked in Q3), respondents will be asked the host question (Q4)
- when the If condition is false, the host question (Q4) will be skipped and a response of Not Asked will be recorded
The text you created within the Routing rules dialog has been inserted within Q4 and is denoted with an arrow highlighted in blue. Double clicking anywhere within the highlighted text will allow you to edit.
The Goto on answer rule is set up within the question codes (answers) of the question. This rule will direct a respondent to a target question within the questionnaire if they tick a particular answer code. For example, if they tick yes to Q1 they go to Q2, if no is ticked, they go to Q3.
This routing type can only be used in question codes and should be used with questions containing a small number of codes. In other cases, use the other two routing rules to decide whether a question is asked or not.
Goto on answer rules are normally only used for single response questions. If a multiple response question has Goto on answer rules on several codes going to different question numbers, Snap follows the routing that goes furthest down the questionnaire.. For example, if a question has routing on one code to go to Q7 and another has routing to go to Q8 and the respondent selects both codes, Snap will automatically jump to Q8.
In the Activate survey, Q1 asks respondents ‘Are you a member of Activate leisure club’. Q2 asks ‘For how long have you been a member’ and Q3 asks ‘Would you be interested in becoming a member here’. This example shows how to set up a Goto On Answer routing rule on the Yes and No codes of Q1 to direct the respondents to the relevant questions.
- Click anywhere in the Yes answer code of Q1.
- Right-click and select Routing Rules from the menu. (You can also click on the Questionnaire window toolbar.)
- Click Add to create a new routing rule. The example below shows that no routing rules have been set up for Q4 as yet.
- Select Goto on Answer as the Type.
- Select Answer 1 (Yes) from the On.
- Click OK.
- Select Q2 (For how long have you been a member?) in the Goto list. This is the question that you want the respondent to go if Answer 1 (Yes) has been ticked.
- The text Go to Q2 appears in the Text box. You can edit the text by clicking and typing inside the box. Q2 is highlighted in blue, which means you can change the information that appears by double clicking on it to open the Goto Target’s Name dialog.
You can select from Full Name, Display Name and Grid Name. Display Name is the default and will display the name of the question as shown on the questionnaire. Full Name will display the full name of the question even if not shown on the questionnaire. Grid Name will display the full grid name as specified in the numbering topic.
- The Style section enables you to alter the number of columns the codes display in. This is useful if the text will be squashed by the Goto instructions.
- Click Add to create a new routing rule for the No code on Q1.
- Select Goto On Answer is in the Type field.
- Select Answer 2 (No) from the On field and click OK.
- Select where you want the respondent to go if answer 2 (No) has been ticked from the Goto box. In this case Q3 has been selected as the question to go to, and the default text Go to Q3 appears in the Text field.
- Click OK.
Using the Questionnaire window for adding routing is a very easy way to add and modify routing rules.
A routing rule can be moved around the questionnaire by clicking and dragging on the highlighted text.
- Click and drag to move the rule and drop once positioned in the right place within the questionnaire.
- To edit the rule, double-click anywhere within the blue shaded area.
- The routing rules dialog is displayed. You can edit the rule by clicking Details>>, delete it by clicking Remove, or create a new rule by clicking Add.
- If questions are moved or copied within the questionnaire, the routing expression that refers to that variable will automatically update.
To help you track the routing rules you have set up in the questionnaire, a summary of this information can be viewed in the Variables window.
This rule is placed at the end of a question and is used to direct respondents to the next appropriate question, to a new section or to the end of the questionnaire. Any number of Goto After Question rules are allowed per question. Once a question is asked the respondents will jump to the next relevant question as directed by the contents of the rule and the answer they have given.
In the Activate survey, Q2 asks respondents “For how long have you been a member?” After they have answered this question we want those respondents to go straight to Q5.
To set up this example:
- Click anywhere in the question where you wish to add routing (Question 2 in this example).
- Click on the right mouse button and select Routing Rules from the menu. Alternatively, click on the button on the Questionnaire window toolbar.
- Click Add to create a new routing rule. The Details>> button allows you to view the content of existing routing rules that have already been created.
- Select Goto After Question from the Type box and click OK.
- The next step is to select where you want the respondent to go from the Goto box. In this example, select Q5 “Do you have any comments you would like to make?”
- Your cursor is located in the If box: this is where you can type in an IF condition if required. In this instance all of the respondents need to be directed to Q5 so leave the If box blank. Further details on routing rules can be found in Routing rules expressions.
- You can alter the text shown on the questionnaire by typing in the Text box. This text will be placed in a footnote at the end of the question.
- Click OK. The routing is set up as shown in the example below.
Routing is quite straightforward if only one thing is happening (for example, if people answer “yes” to question 1, jump to question 3). However, when you start doing more complicated things, there can be limitations on what is possible.
Because of this, the different editions have different routing capabilities
Browsers and devices running Snap Offline Interviewer support all forms of routing. To ensure that the pages with routing on can be built successfully, page breaks may be inserted before a question with routing on it.
Page breaks are inserted if there is text substitution or complex routing (routing that depends on other routing) on that question. Snap has to insert a page break before it to ensure that all the substitutions and routing dependencies are set up before the question is displayed.
Page breaks are not inserted if the question has one level of “Not Asked if” routing.
You can check whether you have simple or complex routing by viewing the routing dependencies. You will only see which page breaks have been inserted when you publish your questionnaire.
- Click on the Snap toolbar to open the Variables window.
- Select the question variable that has routing and the Sources button on the Variables window toolbar to open the Sources/Dependents window
- The Sources pane displays a list of the other variables that this question needs to know the answer to (or whether they have been answered).
- If there is more than one source variable listed, a page break will be inserted before this question. If there is only one source variable, a page break will not be inserted unless on-page routing is disabled or unavailable.
You can use routing to provide different respondents with different surveys
For example, you can route on the ID.site paradata variable to make your survey look different if they have come to it from a different site. This is done by using special links to connect to the same online survey. When a respondent clicks the link, it identifies the survey site, and sets up this information in the Id.site paradata variable. You can then use survey routing to make questions appear or disappear, create derived variables, and so on.
This example assumes that you are running a website satisfaction survey on three different sites, which represent three different branches of your organisation. The same survey will display a different title, depending how you arrived. The example includes brief instructions on writing an HTML file to test that the links to the different versions of the survey work.
The procedure described below will give you an overview of which variables contain routing. If you set up a Conditionally Ask Question routing rule in the Questionnaire window, a Not ask Value is also created. If Go To On Answer and Go To After Question routing rules are set up, relative information is automatically set up in the Goto and Skipped by columns.
- In the Variables window click on to access the Variable Tailoring dialog box.
- Either Change the Show Counts option from Always to Never and click on Keep or Use OR select the routing tick box.
- The Not Asked column reveals any routing in variables. The Goto column displays the target questions and the Skipped by column displays the question where the routing originates. The Valid, No Reply and Errors columns are not displayed.