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.
{#QuestionName}
Parameter
QuestionName
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'll be making substitutions using questions that are all at the same level in the script, but if you have a script that has nested loops you may find that you need to substitute a response to a question that is at a different level. For example, you may 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
{#Qname}
Insert the response to Qname, where Qname is at the same level as the question containing the substitution (for example, both at the root level or both inside the same loop).
{#\.Qname}
Insert the response to Qname, where Qname is at the root (that is, document or top) level.
{#^.Qname} (or {#^.^.Qname} and so on.)
Insert the response to Qname, where Qname 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:
{#\.DrinksLoop[{Water}].HowOften}
to insert how frequently the respondent drinks water.
See also
Text substitution