Desktop User Guides > Professional > Using UNICOM Intelligence Professional > Using UNICOM Intelligence Professional to develop interviews > Accessing sample management data
Accessing sample management data
If your interview will use Sample management when activated in UNICOM Intelligence Interviewer - Server, and the routing section of your interview script (.mdd) file (see Using sample data in interviews) accesses sample data, you can test your interview script before activating it.
Sample Management data is stored in a Sample User XML (.xsu) file, which contains a single sample record with one or more fields. The records and fields are defined using XML syntax. Each field has a name, a type and a value. Note that you cannot have more than one sample record in a .xsu file, and each project's .xsu file must be in the <ProjectMDD>_files sub-directory.
The following sample record is from a file called Participant.xsu, which by default can be found in this folder:
%APPDATA%\IBM\SPSS\DataCollection\<version>\Professional\ Interview
The sample record contains three fields called ID, UserName and Password.
<SampleRecord ID="ID1">
When you create your own sample fields, you must give each field a type. A list of the valid values for the <type> element is shown in the following table. Make sure that the types in your Sample User XML file match the equivalent SQL field types for the sample table (sometimes known as the participants table) that your interview will use after activation.
Value of <type>
Equivalent SQL field type
Char, Text, Ntext, or Nvarchar
For an example of the code you need to write to access the data in the sample record, see [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\Interview\Sample Management - Scripts\Basic\Basic.mdd, which is intended to be used with Participant.xsu. The relevant parts of the script are shown here. When the script is run, the browser displays “Welcome to the Drinks Survey Name1”, because Name1 is the value of the UserName field in Participant.xsu.
Metadata(en-US, Question, label)
  Welcome "Welcome to the Drinks survey {UserName}." info;
End Metadata
' Get the UserName from the sample record
Welcome.Label.Inserts["UserName"].Text = IOM.SampleRecord.Item["UserName"]
End Routing
See also
Using sample management
Sample scripts
Using UNICOM Intelligence Professional to develop interviews