Help Center

Use piping to show given answers in a follow-up question

3 comments

With piping you can show given answers in a follow-up question. This means you automatically process a respondent’s answer in a follow-up question. If they, for example, answer ‘Batman’ to the question “Who’s your favorite super hero?” then that answer will also be shown in the follow-up question “Why is Batman your favorite super hero?”

Piping can be done in 5 ways:

Piping of single select questions

Question types: single select, drop-down list, (multiline) textbox, rating scale, Net Promoter ScoreSM, slider, date picker
  • The most basic type is piping of questions where only 1 response is possible. This can be a selected answer option, but also the answer to an open question.

    The variables used in this case are {{respondent.questions.myDatalabelx}}, {{respondent.questions.myDatalabely}}, … where the datalabels added in your questions can be used eg. movie, sport,…

  • In the survey this variable is replaced by the answer provided to the first, second, … question.

    For Example:

    question piping example
    For this question we used the Data label ‘movie’

    When creating the survey you add the variable  {{respondent.questions.movie}} in the exact spot where the answer given to question 3 needs to be shown: “What genre is {{respondent.questions.movie}}?”

    show the answer provided to question 3 in question 4

    Tip: Using data labels in your questions will make the use of variables easier and will make the variables more legible. e.g. the data label ‘movie’ in Q3 will enable you to use {{survey.questions.movie}

Piping of multi-select questions

Question types: multi-select, listbox, list of textboxes, rank order scale

When using questions where more than 1 answer is possible, you’ll need to be more specific and indicate which answer option out of the source question you want to show.

There are two possibilities:

Answer from ‘other, please specify’

  1. The variable {{respondent.questions.top3}} shows the answer given in the textbox from the “other, please specify” option.
    Say you ask your respondents to indicate the top 3 sports they’ve exercised the most this past year. You sum up 5 frequent sports, but you also provided a 6th option “other, please specify”. Respondents can use this free text field to fill out a sport themselves.

answer-piping-q-en

In a follow-up question you ask about the average frequency they performed these sports. Of course, you want to immediately show the sport that was filled out in the “other, please specify” option, without your respondents having to fill out the same sport again. After all, you already know the sport. They named it in the previous question. In that case you use the variable {{respondent.questions.top3.openAnswer}}. ‘The data label ‘top3’ stands for the question and ‘openAnswer’ for the answer option ‘Other, please specify’.

In your survey the variable will be replaced by the name of the sport provided in question 1.

Attention: If the respondent doesn’t select this particular answer option the variable will be replaced by an empty space. This form of piping is thus only interesting when you are sure the answer has been provided.

It is used very often in combination with extraction whereby only the selected answers are shown in a follow-up question.

  1. The variable {{respondent.questions.drinks.answerChoices.nth-1}} returns the answer to the nth answer choice that the respondent selected – for instance in a checkbox question and the respondent selects the 2nd and 5th answer choices, then ‘nth-1’ would be answer choice number 2 and ‘nth-2’ would be answer choice 5.Take for example the below question. A respondent selected 3 answsers:

    question with selected answer options
    For this question we used the Data label ‘drinks’

    Next you want to ask another question regarding these 3 answer options, but you don’t know whether a particular respondent selected the 1st answer, the 3rd or the last.

    Using the variables {{respondent.questions.drinks.answerChoices.nth-1}} , {{respondent.questions.drinks.answerChoices.nth-2}}  and {{respondent.questions.drinks.answerChoices.nth-3}}  you will show the answers that were selected first, 2nd and 3rd. In the above situation they will respectively change into “Soft drinks”, “Beer” and “Wine”.

     

    The following questions are about {{respondent.questions.1.answerChoices.nth-1}} 

    (Whereas {{respondent.questions.drinks.answerChoices.nth-1}} , {{respondent.questions.drinks.answerChoices.nth-2}} en {{respondent.questions.drinks.answerChoices.nth-3}} would have only shown “Water”, “Soft drinks” and “Diet soft drinks”.))

Attention: Here, too, you need to make sure that 3 options are selected in question 5. Otherwise the variable will only return a blank space.

Piping of the numeric values of answer options

Possible with all question types, but used most often with rating scales

When using a “rating scale” question type you can add labels to each scale. You can, for example, add the label “very bad” to the number 1, and “very good” to number 10.

Note: In the example below, we used the Data label ‘satisfaction’ for this question

When using the variable {{respondent.questions.satisfaction.text}}, these labels would be shown in follow-up questions instead of the underlying, numeric, value.

In order to show these numeric scores, you should use instead the variable {{respondent.questions.satisfaction.scaleValue}}.

For example, you ask the following question:

Value piping source question

This is also the very first question in your survey. Using the variable {{respondent.questions.satisfaction.scaleValue}} you can show the number 1 through 10 in a follow-up question, depending on the answer option that was chosen.

Value piping follow-up question

Had you used the variable {{respondent.questions.satisfaction.scaleValue}} the label “Extremely good” would have been shown, which isn’t what you need in this case.

Piping of matrix questions

Question types: all matrix questions (category: “Tables”)

The third piping option uses a matrix as a source question.

Note: In the example below, we used the Data label ‘sports’ for this question

  • {{survey.questions.sports.subQuestions.2}} shows the 2nd subquestion in question 6 with data label ‘sports’ from the example below
  • {{respondent.questions.sports.subQuestions.2}} shows the selected option for the 2nd sub-question in question 6 with data label ‘sports’ from the example below

Example: You want to investigate your respondents sports activities and ask them to indicate their average weekly activity:

 

Now you want to know where people are going to exercise. Naturally you only ask this question when they actually are exercising, so using branching or page display logic you can specify to only show this question when respondents exercise least once per week.

The variable {{survey.questions.activities.answerchoices.1}} will change into the text label from the selected answer option. In this example the text will change into ‘more than 3 times a week‘.

Query string piping

This form of piping doesn’t show answers given to a specific question, but parameter values used in the survey URL.

A little explanation:

Query strings are the parts of the URL that come after the question mark ‘?’. Each query string is then separated by an ampersand ‘&’. When you use parameters to automatically fill out certain questions you are actually adding query strings to your survey URL.

To be completely exact, the query string “&q1=1”, for example, consists of the parameter name “q1”, the equal sign and the parameter value “1”.

So to summarize, we have:

  • query string: &q1=1
  • with a parameter name: q1
  • and a parameter value: 1

This parameter value can be a number, indicating the nth answer option, or any text that will be filled out in an open text field.

Using the variable {{respondent.questions.myDataLabel}} (basic question piping) you can show the value of this first question in any subsequent question, provided they are on separate pages.

But what if your follow-up question is on the same page as this first hidden question? You don’t want to (or can’t) split them up because you want your respondents to start filling out your survey as soon as possible, without losing time by clicking “Next” too many times.

That is where query string piping comes in.

Use the variable {{querystring.parameterName}} to show the parameter value of that particular query string.
eg. {{querystring.q1}} will return the value of a the parameter in the querystring of the survey URL for question 1.

For example:
You want to measure the level of satisfaction of your customer right after a specific support intervention. Your system registers the name of the person who resolved the ticket as well as a ticket id. In order for your customer to quickly know which support ticket your survey is about, you wish to add it as an introductory sentence.Add the query strings “&q1=[ticketid]” and “&q2=[agentname]” to the survey URL. Then use the variables  {{querystring.q1}} and  {{querystring.q2}} in your survey to show this ticket and agent name, even on the very first page where these hidden questions 1 and 2 are located.

Your ticket {{querystring.q1}} was solved by {{querystring.q2}}

In the survey itself they will look like this:

The parameter itself can consist of anything you like. You could create your own variables from your database or 3rd party systems and add these to the URL (we have a Zendesk example on our Knowledge Base). HTML and JavaScript are not allowed.

Make sure to UrlEncode the parameter value as you are adding it to the URL.

 

Attention: While it is true that piping increases the usability and attraction of your surveys, it can make analyzing the results more complicated. Your reports will always show the variable itself and not the specific value that was filled out for each respondent. But using the available filters in the report with charts you can always find back what each variable stood for.

 

Click here to see an example of piping in a live survey

 

Net Promoter and NPS are registered service marks, and Net Promoter Score and Net Promoter System are service marks, of Bain & Company, Inc., Satmetrix Systems, Inc. and Fred Reichheld.

3 comments

Join the conversation
  • Evangeline - May, 2016 reply

    How can I pipe a question text from a matrix question for which a certain value has been selected from a rating scale?

    Nadia De Vriendt - May, 2016 reply

    hi Evangeline,

    Thank you for reaching out! You can do so by using the piping variable $$$Questx~y$$$, where x is the matrix question number and y is the yth subsquestion.

    So let’s say your matrix question is the 3rd question in your survey and you want to ask more about the score a respondent gave for the 2nd subquestion. In that case you use $$$Quest3~2$$$ in your follow-up question.

    Hope this helps!

  • Evangeline - May, 2016 reply

    How can I pipe a question text for which a certain value has been selected through a matrix question?

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.