Question type

multi

Multiple coded answers from a list of options. Checkboxes, button bars, cards, image cards. Supports answer-count constraints and exclusive options.

What multi is

multi collects zero or more selections from a list of authored options. Answers are stored as a collection of codes, in authored domain order (not the order the respondent clicked). Selection-count constraints — min, max, exact — bound how many items the respondent must pick. An option marked exclusive: True clears every other selection when chosen — typical “None of these” behaviour.

Mockup preview
QFeatures multi checkbox
Which features matter to you?
Select all that apply.
- qid: QFeatures
    type: multi
    text: Which features matter to you?
    instruction: Select all that apply.
    options:
        1: Battery life
        2: Camera quality
        3: Screen size
        4: Build quality
        5: Price

Properties

PropertyValuesNotes
qidstringRequired. Unique within the survey.
typemultiRequired.
title, text, instructionrenderableVisible content. Use {{ }} to pipe runtime values. HTML allowed.
requiredTrue | FalseDefault True.
default.errorsTrue | False | custom stringDefault True (uses the platform’s required-field message).
validationcode blockPython; call fail() to reject. No default.
readonlyTrue | FalseDefault False. Set True to render the question but disable input — the respondent sees it but can’t change the value. Used with scripts that prefill or compute a value. Pair with visibility: hide to fully hide a helper question.
visibilityshow | hideDefault show.
stylecheckbox | buttons | cards | image_cards | dropdownDefault checkbox.
orderkeyword or expressionKeywords: fixed (default), random, randomEach, alphabetical, reverse, flip — see below. Also accepts an expression like Q1.all, Q1.selected, or a literal [2, 4, 1, 3] that resolves to an ordered code list. See Order.
group.ordersame as orderDefault fixed. Order of named groups.
layout.colsintegerDefault 1. Number of columns.
minintegerMinimum selections required. No default (no lower bound).
maxintegerMaximum selections allowed. No default (no upper bound).
exactintegerExactly this many selections. Overrides min and max when both are set. No default.
optionslist name or inline domainRequired when group: is not used.
options.fromexpressionFilter the visible options at runtime. No default.
groupgrouped list nameRequired when options: is not used.
customcode blockCustom runtime block. No default.

order values

ValueBehaviour
fixedRender options in authored order. Default.
randomStable random order — shuffled once per respondent, reused every time the question renders for them.
randomEachRe-shuffle every time the question is rendered. Relevant inside loops.
flipDeterministic split sample — half the respondents see authored order, half see reversed. Consistent for the respondent across every flip surface.
alphabeticalSort options alphabetically by label.
reverseRender in reversed authored order for every respondent.

group.order accepts the same values and behaves the same way against the group dimension.

Group properties

When using group: to subdivide options, each named group can carry:

PropertyValuesNotes
optionsgrouped option entriesRequired.
show.labelTrue | FalseDefault True. Set False to hide the group header label.
anchorTrue | FalseDefault False. Set True to pin the group in place under group.order: random.

Per-option properties

Expand an option to a map to attach extra behaviour.

PropertyValuesNotes
labelrenderableRequired when expanding the option. Use {{ }} to pipe runtime values.
imageURL stringRequired for every option under style: image_cards; optional under style: cards.
anchorTrue | FalseDefault False. Set True to pin in place under order: random.
exclusiveTrue | FalseDefault False. Set True so picking this option clears every other selection in the question. Typical use: “None of these”.
specifyTrue | FalseDefault False. Set True to attach a free-text input to this option.
specify.sizeintegerWidth of the specify input. No default.
specify.maxCharintegerMax length of the specify text. No default — unlimited unless set.
dataobjectMetadata object for advanced authoring (custom code can read it). No default.
options:
    1: Battery life
    2: Camera quality
    3: Screen size
    4:
        label: Other (please specify)
        specify: True
        anchor: True
    99:
        label: None of these
        exclusive: True
        anchor: True

Methods & accessors

The runtime values you read in scripts, conditions, validation, and piping. Return types are exact — see the Glossary for what Code, CodeSet, Label mean.

Accessors

ExpressionReturnsMeaning
Q.selectedCodeSetCollection of selected codes, in authored domain order.
Q.selectedLabelsLabelListCollection of selected labels, in the same order as Q.selected.
Q.allCodeSetAll visible option codes (the effective domain).
Q.allLabelsLabelListLabels for Q.all.
Q.answeredboolTrue once the respondent has made at least one selection.
Q.notAnsweredboolInverse of answered.
Q.selectedLabel does not exist on multi (because there can be more than one selected label). Use Q.selectedLabels.at(0) if you need just the first.

Methods

ExpressionReturnsMeaning
Q.set(N)NoneSet the selection to a single code.
Q.set([1, 3])NoneSet the selection to a list of codes.
Q.add(N)NoneAdd code N to the selection without clearing existing selections.
Q.reset()NoneClear all selections.
Q.specify(N)SpecifyObjectRead the specify text for option N (when that option has specify: True).
Q.row(N)EntryObjectReturns an entry proxy for option N. Exposes .label only — useful for reading the label whether or not the option is selected.

Q.set() also accepts a more explicit per-code form for hidden helpers that need precise control. See Advanced below.

Collection operations on Q.selected

The methods that read naturally on a multi-select answer:

ExpressionReturnsMeaning
Q.selected.sizeintCount of selected codes.
Q.selected.at(N)CodeCode at zero-based position N, in authored order.
Q.selected.any(N)boolTrue if code N is selected.
Q.selected.any([1, 2])boolTrue if any of the listed codes is selected.
Q.selected.every([1, 2])boolTrue if every code in the list is selected.
Q.selected.intersect([1, 2, 3])CodeSetNew collection of overlap. Non-empty result is truthy in if.
Q.selected.union([2, 3])CodeSetCombined collection, deduplicated.
Q.selected.minus([99])CodeSetSelection minus the listed codes — useful for excluding “None of these” before piping.

The same operations also work on Q.selectedLabels, Q.all, and Q.allLabels. See Collections for the full reference.

Skins

Five visual styles. Pick by context — option count, label length, and whether the choice has a visual component.

checkbox Checkbox (default)
Apple
Samsung
Sony
Standard checkbox list. Best for 3–8 options.
cards Cards
Pro
Unlimited responses, basic logic.
Team
Multiple seats, advanced logic.
Tappable checkbox cards with optional description text.
buttons Buttons
Apple Samsung Sony LG
Toggleable pill buttons. Best for 2–5 short options.
image_cards Image cards
Design A
Design B
Image-first cards. Each option needs an image: URL.
dropdown Dropdown
Apple, Samsung ▾
Multi-select dropdown. Useful for long lists where vertical space matters.

The exact appearance is driven by theme tokens — colours, radii, fonts. Every survey is themable from the theme builder; the previews above use defaults. See Customisation and Skin variants.

See it work

A quick interactive preview. Tick options and the Live state panel shows what the runtime stores.

Mockup preview
QFeatures multi checkbox
Which features matter to you?
Select all that apply.
Live state
QFeatures.answeredFalse
QFeatures.selected{}
QFeatures.selectedLabels{}
QFeatures.selected.size0
QFeatures.selected.at(0)None
- qid: QFeatures
    type: multi
    text: Which features matter to you?
    instruction: Select all that apply.
    options:
        1: Battery life
        2: Camera quality
        3: Screen size
        4: Build quality
        5: Price
        99:
            label: None of these
            exclusive: True
            anchor: True

Try ticking a couple of features, then “None of these” — note that the exclusive option clears the others. Pick another feature again and “None” clears.

Methods & accessors — live

The same preview shape, paired with a panel of expressions evaluating against the current selection. Tick options above and watch each expression’s return value.

Mockup preview
QFeatures multi checkbox
Which features matter to you?
Methods & accessors — live
QFeatures.answered → —
QFeatures.selected → —
QFeatures.selectedLabels → —
QFeatures.selected.size → —
QFeatures.selected.at(0) → —
QFeatures.selectedLabels.at(0) → —
QFeatures.selected.any(2) → —
QFeatures.selected.any([1, 2]) → —
QFeatures.selected.every([1, 2]) → —
QFeatures.selected.intersect([1, 2, 3]) → —
QFeatures.selected.intersect([1, 2, 3]).size → —
QFeatures.selected.union([2, 3]) → —
QFeatures.selected.minus([5]) → —

A few things to notice as you click:

  • selected is in authored domain order, not the order you ticked. Tick code 3 first then code 1 — the result is {1, 3}, not {3, 1}. Same goes for selectedLabels.
  • selectedLabels.at(0) is how you get “the first label” — there’s no selectedLabel (singular) on multi.
  • .every([1, 2]) is the canonical “did they pick both of these?” check — different from .any([1, 2]) which is “did they pick either?”.
  • .intersect([list]).size is the workhorse for “how many of this set did they pick?” — useful when the threshold matters (e.g. “must pick at least 2 of 5 hot-button issues”).

Examples

Selection-count constraints

- qid: QTop3
    type: multi
    text: Pick your top three.
    instruction: Choose exactly three.
    exact: 3
    options:
        1: Battery life
        2: Camera
        3: Screen
        4: Build
        5: Price
SettingEffect
min: NMust pick at least N.
max: NCannot pick more than N.
exact: NMust pick exactly N. Overrides min and max.

The runtime enforces these before the respondent can advance. The default error message is the platform’s required-field message; override with default.errors: "your message here" if you want something more specific.

”None of these” — exclusive option

- qid: QBrand
    type: multi
    text: Which of these brands have you heard of?
    options:
        1: Apple
        2: Samsung
        3: Sony
        4: LG
        99:
            label: None of these
            exclusive: True
            anchor: True

- script: |
    if QBrand.selected.any(99):
        endSurvey("terminate")

exclusive: True clears all other selections when “None” is picked (and vice versa — picking another option clears “None”). anchor: True keeps it pinned at the bottom under order: random.

Conditional follow-up

- qid: QSatisf
    type: multi
    text: Which areas need improvement?
    options:
        1: Service
        2: Price
        3: Reliability
        4: Selection

- qid: QWhy
    type: open
    text: Tell us more about what needs improving.
    if: QSatisf.selected.size > 0
    style: textarea
    input.rows: 4

QWhy only shows when at least one area was flagged. .size > 0 is the simplest “did they pick anything?” check.

Pipe the chosen labels into a follow-up

- qid: QBrand
    type: multi
    text: Which brands have you used?
    options: brandList

- qid: QFav
    type: open
    text: Of {{ QBrand.selectedLabels }} which is your favourite, and why?
    style: textarea

The collection of labels stringifies as "Apple", "Samsung" when piped — readable in a question stem. For just the first label use {{ QBrand.selectedLabels.at(0) }}.

Mask the next question

- qid: QBrand
    type: multi
    text: Which brands have you heard of?
    options: brandList

- qid: QFav
    type: single
    text: Which is your favourite?
    options: brandList
    options.from: QBrand.selected.minus([99])

QFav only shows brands the respondent picked — minus the “None of these” code so 99 doesn’t leak into the favourite question.

Combining two multis

- qid: QAwarePast
    type: multi
    text: Which brands have you ever used?
    options: brandList

- qid: QAwareNow
    type: multi
    text: Which brands do you use today?
    options: brandList

- script: |
    everUsed = QAwarePast.selected.union(QAwareNow.selected)
    print("Total brand exposure:", everUsed.size)

    onlyPast = QAwarePast.selected.minus(QAwareNow.selected)
    if onlyPast.size > 0:
        # Brands they tried but no longer use — interesting churn signal.
        hChurnedBrands.set(list(onlyPast))

.union() combines collections (deduplicated). .minus() subtracts. .intersect() finds overlap. These three are the routine set-algebra tools you’ll reach for whenever two multi answers need to be combined.

Validation example

- qid: QChannels
    type: multi
    text: Which channels do you use to research products?
    min: 1
    options:
        1: Search engines
        2: Social media
        3: Friends and family
        4: Industry publications
        5:
            label: Other (please specify)
            specify: True
    validation: |
        if QChannels.selected.any(5):
            text = QChannels.specify(5).value or ""
            if len(text.strip()) < 3:
                fail("Please tell us which channel you mean.")
        # Encourage at least two channels for richer data — but don't block.
        if QChannels.selected.size == 1:
            print("Single-channel respondent — flag for review.")

validation: | runs after the respondent answers. fail() rejects with a message; print() writes to the editor’s diagnostic panel without blocking. Multiple fail() calls short-circuit on the first that fires.

Reusing an option list

For long or shared option sets, declare a - lists: block once and reference by name everywhere — same pattern as single.

- lists:
    brandList:
        options:
            1: Apple
            2: Samsung
            3: Sony
            4: LG
            99: None of these

- qid: QAware
    type: multi
    text: Which brands have you heard of?
    options: brandList

- qid: QUsed
    type: multi
    text: Which have you used?
    options: brandList
    options.from: QAware.selected.minus([99])

Advanced

Patterns that programmers reach for less often, but are worth knowing when they apply.

Tri-state set() — explicit per-code control

In addition to the scalar (Q.set(2)) and list (Q.set([1, 3])) forms, multi.set() accepts a tri-state object that lets you spell out, per code, whether it should be selected, shown but not selected, or not shown at all:

QFeatures.set({
    1: 1,       # selected
    2: 0,       # shown to the respondent, not selected
    3: None,    # not shown — masked out, exports as null
})

Why use it? Because the export tri-state distinguishes 0 from null. With the simpler forms, every unselected code defaults to 0. The tri-state form is the only way to write null programmatically — handy when a hidden helper needs its export shape to match what the respondent would have produced under masking.

A worked example — a hidden helper whose value mirrors a respondent’s choice but explicitly clears the codes that weren’t relevant:

- qid: QFeatures
    type: multi
    text: Which features matter?
    options:
        1: Battery
        2: Camera
        3: Screen
        4: Build
        5: Price

- qid: hPriceSensitive
    type: multi
    options:
        1: Yes
        2: No
    visibility: hide
    readonly: True
    required: False

- script: |
    if QFeatures.selected.any(5):
        hPriceSensitive.set({1: 1, 2: 0})
    else:
        hPriceSensitive.set({1: 0, 2: 1})

If you only need “select these codes”, the list form (Q.set([1, 3])) is simpler and what you should reach for first. The tri-state form is for cases where the export’s 1 / 0 / null distinction matters.

Export

multi fans out to one column per option:

WhatColumn
Code N selected?qidoN (e.g. QFeatureso1, QFeatureso2)
Specify textqidoNSpecify (e.g. QFeatureso4Specify)

Each column is tri-state:

ValueMeaning
1The option was shown to the respondent and selected.
0The option was shown to the respondent and not selected.
nullThe option was not shown — masked by options.from or skipped via if.

The distinction matters whenever options are masked: a null means “they never saw this choice”, which is very different from “they saw it and rejected it”. See Tri-state projection for the full treatment.

See also