Author > Changing the questionnaire order > Adding a Set Response to a questionnaire > Code samples
 
Code samples
The following code samples can be used to set the response for specific question types:
Setting the value from a sample management field
"IOM.SampleRecord.Item["Gender"]"
Setting the value based on an expression (Total awareness example)
"Spontaneous + Prompted"
Filtering answers from AllBrands by the categories defined in BrandsOfInterest
"AllBrands * BrandsOfInterest.DefinedCategories() "
Setting the value for all categories not answered
"Brands.DefinedCategories() - Brands"
Setting the value for a text example
"Name + mr.CrLf + Address"
Setting the value for a Date\Time example
"DateNow()"
Setting the value for a Boolean example
"Income > 100000"
For more code examples, see Creating variables: Examples.
See also
Adding a Set Response to a questionnaire