Question Piping

Question Piping is the ability to use the answer to a question in subsequent questionnaire pages.

For example, let's say a question named "how-often" has been created, using one Extra field. The question asks "How often do you drink?" and four values have been defined, as follows:

Answer value Answer text Extra field 0
1 Never not a factor
2 One or two glasses a day healthy
3 Three to six glasses a day to be watched
4 More excessive

With question piping, the answer's value, its answer text, and its Extra fields, if any, can be used in a subsequent pages.
To use them, insert the following tags anywhere that text can be used, as follows:

Tag Shows as
[/how_often] 3
[/how_often,enteredanswertext] Three to six glasses a day
[/how_often,enteredanswertext,0] to be watched

So, a sentence like this can be used on any page after the question is asked, such as the next page, or the response page:
Your response to "How often do you drink?" had a value of [/how_often], "[/how_often,enteredanswertext]". Your drinking is [/how_often,enteredanswertext,0].
this becomes:
Your response to "How often do you drink?" had a value of 3, "Three to six glasses a day". Your drinking is to be watched.

These piping tags can be used in question text, including questions of type HTML. They can also be used in headers, footers, Actions, and pretty much anywhere - as long as the value has been entered. If not, the tags are replaced by empty space.

More detailed information about each tag:

[/question_name] - the value entered or chosen by the respondent. In an edit field, this is exactly what they entered. In a radio or checkbox field, it is the value that corresponds to this choice. In our example, [/howoften] is replaced with 1, 2, 3, or 4 or nothing if the question was not answered.

[/question_name,enteredanswertext] - the visible text that corresponds to their answer. In our above example, [/howoften,enteredanswertext] is replaced with "Never", "One or two glasses a day", "Three to six glasses a day", or "More".

[/question_name,enteredanswertext,N] - the text that corresponds to what has been entered in Extra field N. For more information on Extra fields, see Design Question Page. If we were using the extra0 field to contain a URL, then <a href=[/howoften,enteredanswertext,0]> would create an HTML link to that URL.

[/authenticateduserid] - the ID of the person taking the questionnaire, using the method specified in the Security page.

[/spotname] - the name of the place for this poll or questionnaire.

[/pollname] - the name of the poll or questionnaire within the place

[/pollid] - both names combined, separated by a '!', eg., DailyPolls!Monday

An excellent use of this capability is in Personalized questionnaires. In this example, an email includes a personalized URL like this:
servlet/viewsflash?cmd=page&pollid=pollingplace!poll&userid=12211&username=John+Peters

The first page of the questionnaire includes an HTML question with this text:
Thank you for participating in our questionnaire, [/username].
This would display as:
Thank you for participating in our questionnaire, John Peters.

When used with localized numbers and dates created with the LocalizedNumber and LocalizedDate styles, piping displays numbers and dates in a locale-indpendent format 1,234.56 and MM/dd/yyyy.
To display these numbers and dates in the format appropriate to the locale of the user's browser, use these tags instead:
[/localized,question_name]

These elements can also be used in redirects. For example, on the Response page and the Security page redirects, you can redirect to
"*?q=r&t=[/howoften]"
which will redirect to "...?q=r&t=3 in the above example.

 

Next: Revealing Questions