Question piping allows you to display a question in a specific location on a page, separate from where its widget is defined.
Question definition:
1. This question text will not display if piped.
type: text
Piping to another location:
__Q1__
Tip! For information on how to display specific answers to a question, see Response piping and get_answer.
Details
- To relocate a question, wrap the question reference in double underscores (
__Q1__
) and place it where needed. - The original question location is hidden automatically.
- The question text and ID are omitted in the piped location by default. To show the question text, add the
template_data: { show_text => 1 }
tag. This is explained further in the next section. - Global system defaults, such as
required: y
, still apply.
Showing the piped question text
When piping a question, its text and question number do not automatically appear at the display location. For closed-ended questions, only the options are shown. For open-ended questions, only the text field is displayed. To show the question text in the piped location, add template_data: { show_text => 1 }
to the original question definition.
1. This text will now display even if piped. type: text template_data: { show_text => 1 }
__Q1__
Note, if the question is piped into an answer option location, as shown in the next example, the question text cannot be displayed.
Additional examples
Piping a question into an answer option
In the following example, Q2P is embedded within Q2's option 2, allowing respondents to enter a number (0–100) if they select this option. Q2 captures the selected option ID, while Q2P separately records the numeric response.
Piping a question into a custom table
You can also create a custom HTML table to place the question within a specific part of the table. For example, you could place an image or a descriptive text on the left and then display the question on the right.
Comments
0 comments
Please sign in to leave a comment.