Desktop User Guides > Professional > Interview scripting > Interview scripting: Getting started > Writing and using a shared list
 
Writing and using a shared list
Some interview scripts might contain a number of categorical questions that use the same response list. Rather than retyping the response list for each question or copying it from one question to another, you can define the response list as a shared list and then use it with each question that needs those responses.
This example shows how to have two categorical questions that ask respondents to choose one or more teas from a list of tea types. The first question is a multiple choice question where respondents are asked which types of tea they drink; the second is a single choice question that asks which is their favorite tea.
You can define shared lists anywhere in the interview script, but when you close and reopen the file, the lists are at the top of the metadata section.
Procedure
1 Enter a name for the shared list and follow it with the define keyword:
TeaList define
2 Enter the response list exactly as you would for a categorical question. Categories that contain spaces or other non-alphanumeric characters must have a display text as well as a name. End the list with a semicolon:
TeaList define{
  Assam,
  Darjeeling,
  LapsangSouchong "Lapsang Souchong",
  Gunpower,
  Ceylon,
  China,
  Oolong,
  EnglishBreakfast "English Breakfast",
  Black,
  Rooibos,
  Puerh,
  EarlGrey "Earl Grey",
  Green,
  OrangePekoe "Orange Pekoe",
  FruitHerbal "Fruit/Herbal"
};
3 Write a multiple-response categorical question that uses the shared list. Enter the question name, question label, type, and number of allowed responses for the TeaDrink question as follows:
TeaDrink "Which of the following teas do you drink?" categorical [1..]
4 Instead of writing the list of responses, specify that the question uses the TeaList shared list:
TeaDrink "Which of the following teas do you drink?" categorical [1..]
{
  use TeaList
};
5 Write a single-response categorical question that asks which is the respondent's favorite tea. The only difference between this and the previous question is the specification for the allowed number of responses:
FavoriteTea "And which is your favorite type of tea?" categorical [1..1]
{
  use TeaList
};
6 Add an Other response for respondents whose favorite tea does not appear in the shared list:
FavoriteTea "And which is your favorite type of tea?" categorical [1..1]
{
  use TeaList,
  OtherTea "Other Tea" other
};
Requirements
UNICOM Intelligence Professional with Interview Scripting.
Next
Writing repeated questions
See also
Interview scripting: Getting started