Description: Describes how to use piping in your survey to dynamically insert text or values into questions and answers.
Piping is the process of taking an answer to one question in your survey and displaying it as text in any following question in your survey.
Here is an example of how piping is added to a Vista survey:
In this example, the answer the respondent selects for Question 1 will be displayed in place of the [Q1] placeholder in Question 2.
The survey participant will select an option from the first question:
And, when the survey participant clicks Next, the option that the participant selected in the first question is displayed in the second question:
How to use Piping
Every question in Vista is given a number to identify the question. The first question in your questionnaire is identified as Q1, the second question is Q2. You can insert responses from any question into any subsequent question's text by using the identifier [Qn], where "n" refers to the number of the question.
For example, if you ask a respondent for their name in Question 1, you can use that name in subsequent questions by inserting [Q1] where you want the name to appear. Similarly, [Q2] refers to the second question's answer and so on.
Piping in Multiple Choice questions
Questions with options and values such as checkboxes or a text field also are given an identifier. Options and values are identified as Q1.1, Q1.2, and Q1.3, as in the example below.
Piping in Select Many questions
In Select Many questions, you can add an identifier to refer to a particular item. For example, [Q6.3] will return the text of the third answer if it is selected, or blank if it is not selected.
Piping for Matrix and Form questions
Each row of a matrix or form question is identified using  and letters. For example, the first row of a matrix or form question is [Q1a], the second is [Q1b], etc.
By column and row
You can add another identifier to refer to a particular column value even if it has grouped radio buttons. For example, the first column in the first row of Question 3 Matrix Group Radio buttons is referenced as [Q3a.1].
Finding the correct question and/or answer identifier for piping purposes
There are two ways to find the correct question and/or answer number to use when piping:
The first way is to change the view on the Edit tab to Condensed to see Vista's question numbers. For information about changing the view of the Edit tab, see the Overview of the Edit Tab page.
Here is how a questionnaire displays in the Condensed view:
The second way is to go to the Results tab, choose Download Raw Data, and generate a report.
The download file will display Vista's question numbers. The following example shows how Vista displays the table cell identified as Q4a.1 in its own row in Excel.
For more information about the Download Raw Data operation, see Downloading Raw Data.
To pipe the answer from a question to a question that follows, there must be at least one page break between the source and destination questions. For example, if you want to pipe the response to Question 2 into Question 5, you will need to insert a Page Break somewhere between Question 2 and Question 5. For more information about inserting page breaks, see Adding a page break.
The following are some examples of pipe codes for various question types. These examples assume the question you want to pipe is Question 1.
- Multiple Choice / Yes-No / Drop-Down
- [Q1] returns the text of the selected option
- Select Many
- [Q1] returns the text of all the selected options with comma separators, e.g. Option 1, Option 2
- [Q1.1] returns the text of the first option if selected, or a blank value if not selected
- Other Text Box
- [Q1a] returns the text of the Other Text Box. If your question uses an Other Text Box, then the Other Text Box is [Q1a] and the listed options become [Q1b], [Q1c], and so on.
- Text Box / Text Area / Number Box / Password
- [Q1] returns the text of the answer
- Rank Items
- [Q1] returns the items selected in rank order with comma separators, e.g. Option1, Option 2
- [Q1.1] returns the first item selected
- Form Questions
- The first form item can be referenced by substituting [Q1a] for [Q1] in the examples above, second form item is [Q1b], etc.
- Matrix Questions
- The first matrix row can be referenced by substituting [Q1a] for [Q1] in the examples above, second matrix row is [Q1b], etc.
Piping the Value of Answers when building formulas
The [Qn] identifiers pipe the text of the option selected by a user, or the text that a user enters, into a question as text. Each option in a question also has an index value associated with it such as 1, 2, 3. These index values can be useful when building formulas in advanced Vista surveys.
You can pipe the value of an answer rather than the text by using the format [Vx]. The following example shows the value for [V1] for each option in question 1.
The default value for an option is 1 for the first answer, 2 for the second answer, etc. You can also specify your own values for each option. For more information about assigning a value to question answers, see Assigning a Value to Answers.
Piping Invitation Fields
You can pipe a value from respondent invitation data by using the code [%FieldName%]. For example, to insert the respondent's Name, you can use the code [%Name%]. You can use this technique for Standard Fields or Custom Fields (i.e. Name, Email).
Other uses of Piping
Piping is a technique that can be used to do a number of different things in your survey. Here are some examples of things you can do with piping.
- Make the answer to a question the default for a subsequent question. Just use the piping code in the Default Value property of the question.
- Show a concise Summary page at the end of your survey by piping in the answers to all the questions on the survey.
- Personalize the survey with Invitation data. The Welcome page can include the respondent's name and company.
- Pipe data passed into the survey through Hidden Questions. For more details about Hidden Questions, see the Using URL Parameters in a Survey page.
- Pre-fill surveys or forms with the user's data. For example, in an Update Contact Information form you can pre-fill the fields with the contact information you have for them.
- Show calculated values based on answers to your survey. Display a "score" at the end of an assessment. For more information, see the Formulas or Calculated Questions page.
- Create advanced conditional logic such as logic based on the answer to multiple questions. For more information, see the Advanced Ask if Logic page.