Help Center

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


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 $$$Quest1$$$, $$$Quest2$$$, … where ‘1’ stands for the first question, ‘2’ for the second question, etc.

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

For Example:

question piping example

When creating the survey you add the variable $$$Quest3$$$ in the exact spot where the answer given to question 3 needs to be shown: “What genre is $$$Quest3$$$?”

show the answer provided to question 3 in question 4


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:

  1. The variable $$$Questxy$$$ show answer option y to question x.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.


    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 $$$Quest1-6$$$. The ‘1’ stands for question 1 and the ‘6’ for the 6th answer option in the list. Both numbers are separated by a hyphen (‘-‘).


    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.


  2. The variable $$$Questx_y$$$ (mind the underscore!) shows the answer option that was selected yth in question x.Take for example the below question. A respondent selected 3 answsers:

    question with selected answer options

    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 $$$Quest5_1$$$, $$$Quest5_2$$$ and $$$Quest5_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”.


    (Whereas $$$Quest5-1$$$, $$$Quest5-2$$$ en $$$Quest5-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.

When using the variable $$$Questx$$$ 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 $$$QuestValuex$$$. Simply replace the ‘x’ by the question number.

For example, you ask the following question:

Value piping source question

This is also the very first question in your survey. Using the variable $$$QuestValue1$$$ 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 $$$Quest1$$$ 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.

By placing a tilde (‘~‘) between the question number and the response option, you can specify which sub-question should be used as the source, e.g. $$$Quest1~2$$$ shows the selected option for the 2nd sub-question in question 1.

If you only want to show the value from a specific column in your matrix you can dig even deeper and use $$$Quest1~2-3$$$.

The meaning of each number in this example variable is as follows: the number 1 stands for the first question in the survey, the 2 stands for the second sub-question and the 3 stands for the third column in the matrix.

Example: You want to investigate your respondents’ drinking behavior and ask them to indicate their average weekly volume:


Now you want to know where people drink spirits. Naturally you only ask this question when they actually drink spirits, so using branching or page display logic you can specify to only show this question when respondents drink at least 1 glass per week.


The variable $$$Quest6~6$$$ will change into the selected number of glasses for sub-question 6 in the matrix.


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:

  • a 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 $$$Quest1$$$ (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 $$$QS-parametername$$$ to show the parameter value of that particular query string.

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 $$$QS-q1$$$ and $$$QS-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.

query string piping variable in the survey edit page

In the survey itself they will look like this:

example of query string piping

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.


Related articles


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.