Displaying Responses Given to Previous Questions

Top  Previous  Next

You can display responses given to previous questions by referring to the question names (in skip logic, list building logic, or inline Sawtooth Scripting).  (Some researchers refer to this as piping.)  If you are displaying text to the screen (for example, returning the answer for a previous question within a Header1 field for a question), you must enclose the question name within [% ... %] tags, such as:

 

 [% Q1 %]   returns the response recorded in the database for Q1

 

If you are referring to the answers in other areas of Lighthouse Studio, skip logic, and quota control, you do not include the [% ... %] tags.

 

If the response is not in the database, a blank is returned.  In some cases, you might not want to return the answer in the database, but the label that is associated with it.  With single select type questions such as select, radio, combo, or grid, you can use LABEL(Q1) to return the label.  Example:

 

 [% LABEL(Q1) %] returns the label associated with the response recorded in the database for Q1

 


Example: Showing Response Given to a Previous Numeric Question

 

Let's assume that you wanted to display the numeric value that the respondent provided earlier in the questionnaire in a question called "housesize."  For example, in the Header1 text section of a select-type question called "numminors", you might type:

 

You previously said that you have [% housesize %] people in your household.  How many of those individuals are minors (17 or younger)?

 

When the questionnaire runs over the server, the numeric value that was provided in the question named "housesize" is displayed instead of "[% housesize %]".

 


Example: Showing the Label for a Single-Select Question

 

Let's assume you asked respondents to indicate their favorite color, using a select-type (radio) button question called "FavoriteColor."  For example, in the Header1 text question of a follow-up question, you might type:

 

You previously said that your favorite color was [%Label(FavoriteColor)%] .  

 

 


Example: Showing the Label for a Single-Select Question from a Grid

 

Let's assume you asked respondents to indicate their favorite color, using a select-type (radio) button question within the third column in a grid with column-based questions called "Colors."  

 

grid_colors

 

To show the respondent's favorite color on the screen in a later question, you might specify:

 

You previously said that your favorite color was [%Label(Colors_c3)%] .  

 

Because Colors is a column-based grid question, the underscore notation referring to column "_c3" returns the row label associated with the answer to column 3.  If the grid question were row-based, underscore notation returns the column label associated with the response to the referenced row.

Page link: http://www.sawtoothsoftware.com/help/lighthouse-studio/manual/index.html?hid_web_dispprev.html