Piping allows you to dynamically change your survey questions or answers, based on answers that have been provided by the respondent, or other variables.
It works by adding merge codes to the survey content, with each merge code defining a variable that's going to inserted into the survey content.
Merge Codes (sometimes known as piping tags) look like this example:
Under most circumstances, you won't need to type these out, and will get these codes by picking from a list.
Piping can be used in two different ways:
- With Question Piping, you re-use an answer in a subsequent question
- With Answer Piping, you re-use an answer in a subsequent answer
You can see both types of piping in action in this example survey.
Understanding Question Piping
Question piping takes the answer from a question, and then inserts that answer in subsequent questions in the survey.
You ask the respondent to select their favourite drink from a multiple choice list - for example tea, orange juice or water.
- If they select tea, the next question could ask: How much tea do you drink each day?
- If they select orange juice, the next question would read: How much orange juice do you drink each day?
In the above example, the answer from the question is inserted into question text.
Understanding Answer Piping
Answer piping takes the answer from a question, and then inserts that answer in subsequent answers in the survey.
You ask the respondent to select their favourite drink from a multiple choice list: tea, orange juice or water.
- If they select tea, you can then ask them to rank tea against two other drinks, hot chocolate and coffee
- If they select orange juice, you can ask them to rank orange juice against hot chocolate and coffee
In the above example, the answer from the question is inserted into answer text.
Creating Piping in a Survey
To demonstrate piping, we will use a multiple choice question as the first question. We will then re-use the answer in the text of the second question:
- Click on My Surveys at the top of the page
- Next to the survey you want to use, click the Design icon
- Click Add Question Here
- In the Question Type drop-down menu, select Multiple Choice (Only One Answer)
- Type the first question in the Question Text. For example: What is your favourite drink?
- Type the multiple choice answers in the Answer Choices box. For example: Tea, Coffee, Water
- Select any other answer options and click Add Question to save
You can now create the second question, which will incorporate the answer from the first one. The second question must appear on a new page, and must appear after the first question.
- Click on the Insert Page Here button bottom left of the question just created - naming the page is optional (if adding a question between other questions with no page break, click on the grey Split Page Here button which will bring up the Insert Page Here button)
- Leave all boxes blank unless you want to add an optional Page Title and Description. Click Save Page
- Within the new page, click Add Question
- In the Question Type drop-down menu, select Comment/ Essay Box
- Type the first question in the Question Text field, without the answer that you want to pipe. For example, “Why do you love so much?”, omitting the word ‘tea’ from the sentence
- Position your mouse where the missing word is, and click or tap to position the cursor there. For readability, ensure there is a space on either side of the cursor
- Click the Insert Piping link underneath the Question Text field
- In the Piping drop-down list, select the desired question from the list
- Click Insert to insert the code snippet
- Select any other options then click Add Question to save
Test your piping carefully before publishing a survey to ensure that the answers are carried forward in the expected way.
Piping With Other Variables
Piping can also be used to include system variables in questions.
For example, you could re-use the email address the survey was sent out to as an answer in the contact details form.
To use these variables, simply select the relevant variable from the Piping drop-down list when creating your question.
Piping from questions that can have multiple answers
If a question can have multiple answers for a single question/sub-question/row (Multiple choice - Multiple answer, Matrix - more than one answer per row, etc) then the output of that question will be piped as a single comma-separated list. It can be modified to use different seperators, but will always be a single list.
Example question and output:
The above question, answered as illustrated, will be output from a piping tag as:
This means that there's a limitation on using piping from a question as above to then populate separate answer choices for a follow-up question. It's not possible to pipe out of the kind of question illustrated above to form the different options for a (ranking, for instance) question - because piping won't seperate out the list into seperate elements to make different answer options.
Changing the delimiter
It's possible to change the delimiter used for the output. The default piping tag [question(12345678)] will output the comma-seperated format above.
By editing the piping tag, this can be chaned to semicolons (;) or pipes (||) but adding ":semicolon" or ":valuepiped" after the question ID number
[question(12345678:semicolon)] gives: Red;Green;Blue
[question(12345678:valuepiped)] gives: Red||Green||Blue