Author > Formatting questionnaires > Substituting text in a question
 
Substituting text in a question
You can add substitution fields to the text in a question, so that when the questionnaire is shown in an online format such as web or telephone interviewing the code is replaced with the text from the response to a previous question.
For example, you might ask “If you could go on vacation anywhere in the world, where would you go?” followed by one or more questions about the respondent's preferred destination. The text of the subsequent questions could include the text of the first response, so if the respondent answered Hawaii, the questions would appear as: “Why did you choose Hawaii?”, “Have you ever visited Hawaii?”, When was the last time you visited Hawaii?”, and so on.
You can substitute response text taken from any of these types of question:
single response
multiple response (all selected responses are displayed, separated by commas)
text (the exact text that the respondent typed is displayed)
numeric
date/time
true/false (the text True or False is displayed).
Syntax for inserting responses from another question
Substitution fields are enclosed in curly braces {}.
{# QuestionName }
Using substitution fields inside loops
You can also add substitution fields to the text of questions inside a loop, so that the question text changes each time the questions are asked in the loop, based on the loop driver. For example, suppose that you have a loop that contains a number of questions about vacations. If you use a numeric question or a fixed number of iterations as the loop driver, the iteration number appears each time the question is asked.
If you use a multiple response question the text of the relevant response appears each time the question is asked.
Syntax for inserting iterations of a loop
{@ LoopName }
Advanced text substitution features
Additional functionality is available by using interview scripting: see the UNICOM Intelligence Developer Documentation Library.
See also
Substituting a response from a previous question
Substituting the text from a loop iteration
Formatting questionnaires