Extraction
With extraction, you can make sure that subsequent questions only show certain options that your respondents have marked in a previous question. This way, respondents will only see the answer options that matter to them.
To set up extraction, first create your source question and your target question (the question that will only show the options marked in the source question). Make sure both questions are on separate pages. Also make sure that the answer options are in exactly the same order. These answer options do not need to have the same wording.
- Open your survey and edit your target question.
- Select the Settings tab.
- Select the source question in the Extraction based on dropdown.
-
Click Save.
Example
This is the source question in which your respondents indicate what kind of weather they like.
In the target question, your respondents will only see the options they have selected in the source question. The other two options are not important so they do not need to provide a score for them.
It is also possible to apply extraction to a question that is asked a few questions later. The source and target question do not necessarily need to be subsequent questions. As long as the questions are on separate pages and the options are in the same order, extraction is possible.
Extraction from a matrix question
The extraction dropdown menu will not contain matrix (table) questions, as there are too many possibilities from which to extract.
Do you want to show only the sub-questions that received a positive evaluation? Or a negative one? If your question is about usage, as of how often something is used, must the item be shown? Once per week? Every day?
When you want to extract from a matrix question, you will have to use question display logic to hide the items that do not match your requirements.
Example
Let's say your source question (i.e., the matrix question) is about how often people consume certain products:
And your follow-up question only concerns the products that people consume at least weekly.:
In that case, it makes no sense asking this question about the products where people ticked 'Monthly', 'Less than monthly', or 'Never'. In other words, you must hide these products if columns 3, 4, or 5 were selected for the corresponding sub-questions in the matrix.
You do this as follows:
- Create your source and target questions
- Add a question data label, preferably to both questions, but at the very least to the source question. You will need it later for the CSL code.
- Edit the target question and select the Display logic tab.
- Set each response option to Hide if.
- Now add the following CSL code.
{{gt respondent.questions.[LABEL].subQuestions.x.orderNumber '2'}}
- Replace [LABEL] by your source question's data label.
- Replace x by the number corresponding to the order of the sub-question. If it's the first sub-question you're referring to, use '1', if it's the second sub-question, use '2', etc.
-
Click Save.
The code states that if the column number (indicated by 'orderNumber') is greater than ('gt') 2 (i.e., if columns 3, 4 or 5 have been selected), then this response must be hidden from the respondents.
Other examples
The same syntax can be used in rating scale type matrix questions (e.g., when respondents must select a score lower than a certain number).
Or, of course, you can do the opposite, and a higher score (i.e., column) must be selected. In that case, you don't use 'greater than' as a hide if condition, but 'less than', which is the operator 'lt'.
{{lt respondent.questions.[LABEL].subQuestions.x.orderNumber 'y'}}
If it's just one answer, that will cause for an option to be hidden, then use the 'equal to' operator, or 'eq':
{{eq respondent.questions.[LABEL].subQuestions.x.orderNumber 'y'}}
Branching and page display logic
It is always possible that someone does not select any of the required options in the source question. For regular questions, this will be the case when you add a 'None of the above' option. For matrix questions, there are many possibilities. In that case, make sure to add either branching or page display logic so that the respondents don't receive an empty follow-up question.
To make sure you've got all options covered, test the survey thoroughly.