[Back]  [Print Page]
Using Piping
Keywords: x

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:

piping example 1 

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:

piping question 1 

And, when the survey participant clicks Next, the option that the participant selected in the first question is displayed in the second question:

piping result 

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 q1 

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.

multiple choice piping 

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.

select many questions

Piping for Matrix and Form questions

By row

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.

piping matrix by row 

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].

piping by column and row 

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.
 
condensed view
 
Here is how a questionnaire displays in the Condensed view:
 
condensed view 2

The second way is to go to the Results tab, choose Download Raw Data, and generate a report.
 
download raw data  
 
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.
 
raw data piping
 
For more information about the Download Raw Data operation, see Downloading Raw Data.

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

Piping Examples

The following are some examples of pipe codes for various question types.  These examples assume the question you want to pipe is Question 1.

  1. Multiple Choice / Yes-No / Drop-Down
    • [Q1] returns the text of the selected option
       
  2. 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
       
  3. 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.
       
  4. Text Box / Text Area / Number Box / Password
    • [Q1] returns the text of the answer
       
  5. 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
       
  6. Form Questions
    • The first form item can be referenced by substituting [Q1a] for [Q1] in the examples above, second form item is [Q1b], etc.
       
  7. 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.

piping values 

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.