Help Center

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.

Apply extraction

First create your source question (the question you are going to base yourself on) 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, though.

  1. Click on the icon  next to the target question and click Edit.
  2. Go to the Settings tab.
  3. Here you will see the option Extraction based on.
  4. Select the correct source question in the drop-down menu and click on Save.
Attention! Extraction is possible as of the second page of your survey as you cannot select previous questions yet on the first page.

To illustrate

Below you can find an example of what extraction looks like for your respondents. We also have a short extraction demo available on our website.

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 to extract from.

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 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:

product consumption

And your follow-up question only concerns the products that people consume at least weekly.

product consumption

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, 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:

  1. Create your source and target questions
  2. 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.
  3. Edit the target question and go to the Display logic tab.
  4. Set each response option to Hide if.
  5. 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.

  6. Click on 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'}}

Don’t forget about branching or 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, the possibilities are – again – legion.

If that possibility is real, 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.

6 comments

Join the conversation
  • Shusmita Rahman - September, 2018 reply

    Hi,
    I am building a survey for the organization I work in. My source question has the option of “Other, please specify” and I would like to carry the answer through to the target question. Right now when I put “Other, please specify” as one of the options in the target question (where I hoped that the answer from the source question would be carried over), I just get the option as is with an open text box again, and the answer from the source question is lost. Is there a way to carry the response over?

    Thank you

    Nadia De Vriendt - September, 2018 reply

    hi Sushmita,
    You’ll need to put a variable {{respondent.questions.mylabel.answerChoices.1}} instead of activating the ‘other please specify’ again. Replace the ‘mylabel’ by the data label used and the ‘1’ by the place of the response that you want to show.

    So, for example, if your source question is question 5 with datalabel mylabel and the ‘other please specify’ is the 6th possible response, put {{respondent.questions.mylabel.answerChoices.6}} in the target question. Don’t tick ‘other please specify’ in your follow-up question. You don’t need it in this particular case.

    When you do that, the answer provided in the ‘other’ box will be shown in the follow-up question.

    This method is also explained in the following article: Use piping to show given answers in a follow-up question.

  • steve - November, 2016 reply

    How do I use only the answers from a response list not selected to appear at a follow-on question (first mention/all other mentions)?

    Nadia De Vriendt - November, 2016 reply

    hi Steve

    That is also possible, with some help from our programmers.

    I see you’ve also opened a ticket with our support team concerning this specific use-case. We’ll get back to you via that ticket.

  • Niels - June, 2016 reply

    It is unclear to me how I could use Extraction to use the answers to a list of textboxes as sub-questions in a Matrix checkbox. When editing the Matrix checkbox I am able to select the right question to extract from, but when I hit ‘save’, a message warns me that I need to fill in a minimum of 1 sub-question. How can I avoid this?

    Nadia De Vriendt - June, 2016 reply

    hi Niels,

    In that case you need to combine extraction with piping. You simply put the correct piping variables as the sub-questions in the matrix.

    If your list of text boxes is question 4 and it has 5 textboxes, you put the following variables in your matrix:

    • {{respondent.questions.mylabel.answerChoices.1}}
    • {{respondent.questions.mylabel.answerChoices.2}}
    • {{respondent.questions.mylabel.answerChoices.3}}
    • {{respondent.questions.mylabel.answerChoices.4}}
    • {{respondent.questions.mylabel.answerChoices.5}}

    This set-up, combined with extraction, makes sure that only the options that were actually filled out in the list of text boxes will come back – literally – in the matrix.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.