List questions are recorded as Tuple<decimal, string> data type.
Each item in a list question response consists of two elements. One is the item number, and the other is the accompanying text. For example, in the list question displayed. “Paul Smith” is the text element (Item2) and “2” is the number(Item1).
The following functions can be used in conditions for list questions:
- Length.Checks the number of items listed
- Item2 . Refers to the text element of an item listed in a list question
Checks the number of items listed.
This function checks the number of items recorded in a list question
Assume that there is a question asking for the number of household
members (hholdNum). Elsewhere, in the questionnaire there is a question
asking for a list of all household members(hholdList). You want to check
to make sure the answers given in the list question are consistent with
the previous question.
Or alternatively use the variable name:
hholdList.Length == hholdNum
Refers to the text element of an item listed in a list question.
This feature must be used in a more complex expression. Refer to example
1 below for more information.
Suppose you want to make sure that in a list question (hhold_list)
recording the list of household members the text element meaning the
name being recorded is at least 5 characters long.
For this check, the validation condition would be: