Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Displaying information on a page > Text substitution > Displaying answers in question and banner texts
 
Displaying answers in question and banner texts
Syntax
To display the answer to a question in the text of another question or in a banner, use this command in the question or banner text at the point at which you want the substituted text to appear.
{#<question_name>}
Parameter
<question_name>
The name of the question whose answer you want to display.
Example
Name "What is your full name?" text [5..50];
Thanks "Thank you, {#Name:u}, for taking part in our survey."
info;
The :u in the Thanks example is a formatting specification that forces the name to be displayed with the first letter in upper case, regardless of how the respondent typed their name. For more information, see Formatting substituted values.
Notes
If the substitution does not work and you see the marker rather than the text it represents, check that you typed # in front of the marker name and that the marker name is spelled correctly.
Most of the time, you make substitutions using questions that are all at the same level in the script, but if you have a script that has nested loops, you might need to substitute a response to a question that is at a different level. For example, you might want to substitute a response from a question at the top level of the script in a question that is at the lowest level of a nested loop. The general procedure is the same for all substitutions; you just need to include some extra characters to show what level the substituted value is coming from:
Use
To
{#<question_name>}
Insert the response to <question_name>, where <question_name> is at the same level as the question containing the substitution (for example, both at the root level or both inside the same loop).
{#\.<question_name>}
Insert the response to <question_name>, where <question_name> is at the root (that is, document or top) level.
{#^.<question_name>}
or
{#^.^.<question_name>}
and so on)
Insert the response to <question_name>, where <question_name> is at the parent level relative to the current question (or an ancestor, depending on the number of ^. operators included).
If the response you want to insert belongs to a question that is part or a block or loop, you can use the full question name to refer to it. For example, to insert how frequently the respondent drinks water, use the following statement:
{#\.DrinksLoop[{Water}].HowOften}
See also
Text substitution