The select_multiple question type displays a list where the respondent can select one or more options. By default choices render as checkboxes. The stored value is a space-separated list of all selected choice values.

Basic XLSForm Specification

survey worksheet:

typenamelabel
select_multiple cropscrops_grownWhich crops does the household grow?

choices worksheet:

list_namenamelabel
cropsmaizeMaize
cropsbeansBeans
cropsriceRice
cropsvegetablesVegetables
cropsotherOther

For more details see the XLSForm specification.

Stored data format

The exported column contains a space-separated list of selected values:

  maize beans vegetables
  

Use the selected() function — not = — when testing select_multiple values in expressions (see below).

Uses

Select_multiple questions are used for:

  1. Collecting multiple applicable answers (e.g., sources of income, crops grown, symptoms)
  2. Checkbox-style agreement items (e.g., “Select all that apply”)
  3. Language or skill inventories
  4. Any question where multiple answers are simultaneously valid

Appearance options

AppearanceDescription
(none)Default checkboxes, one per line
minimalDropdown multi-select widget
compactCompact grid, columns adjust to screen width
compact-NCompact grid forced to N columns
horizontalChoices arranged horizontally in a row (web)
horizontal-compactHorizontal, compact spacing (web)
labelShows only labels, no checkboxes (use with list-nolabel)
list-nolabelShows only checkboxes, no labels (use with label)
columns(N)Display in N columns (rtSurvey extension)

Example: 3-column compact layout

typenamelabelappearance
select_multiple symptomssymptomsSelect all symptoms observedcompact-3

Using selected() in expressions

Because the stored value is a space-separated string, you must use selected() to test whether a specific choice was picked. Using = will not work correctly.

In relevant

Show a follow-up question only if “other” was selected:

typenamelabelrelevant
select_multiple cropscrops_grownWhich crops are grown?
textcrops_otherPlease specify other cropsselected(${crops_grown}, 'other')

In constraint

Require at least 2 choices:

typenameconstraintconstraint_message
select_multiple issuesissuescount-selected(.) >= 2Select at least 2 issues

Limit to a maximum of 3:

typenameconstraintconstraint_message
select_multiple prioritiesprioritiescount-selected(.) <= 3Select no more than 3 priorities

In calculate — joining selected labels

Combine selected-at(), count-selected(), and choice-label() to build a readable summary:

typenamecalculation
calculatecrops_summaryjoin(’, ‘, ${crops_grown})

“None of the above” / exclusive option

A common pattern is to make one option mutually exclusive with all others. Use a constraint to enforce it:

typenamelabelconstraintconstraint_message
select_multiple issuesissuesSelect all issues presentnot(selected(., 'none') and count-selected(.) > 1)“None” cannot be selected with other options

choices:

list_namenamelabel
issueswaterWater shortage
issuesroadsPoor roads
issueshealthLack of health services
issuesnoneNone of the above

Counting and summarising selections

FunctionExampleResult
count-selected(field)count-selected(${crops_grown})Number of choices selected
selected(field, value)selected(${crops_grown}, 'maize')true/false
selected-at(field, index)selected-at(${crops_grown}, 0)First selected value
choice-label(field, value)choice-label(${crops_grown}, 'maize')Label for a value

Best Practices

  1. Always use selected() in relevant, constraint, and calculate — never = or !=.
  2. Add a constraint to limit the maximum number of selections if the question design requires it.
  3. Include a “None” or “Not applicable” option when zero selections is a valid answer.
  4. For long lists (15+ choices), use minimal (multi-select dropdown) to avoid excessive scrolling.
  5. Export data and use string-splitting in your analysis tool — the space-separated format requires splitting before pivoting.

Limitations

  • Select_multiple values cannot be directly compared with =. Always use selected().
  • The compact appearance may not render well for very long choice labels.
  • When filtering choices with choice_filter, filtering applies to all displayed choices, same as select_one.
Беше ли полезна тази страница?