Properties

Choices & domains

How options, groups, scales, rows, and per-entry properties (specify, anchor, exclusive) are authored. The shape of every coded domain in the survey.

options — coded list of choices

The most common domain. A map from numeric code to display label.

- qid: QBrand
    type: single
    text: Which brand do you prefer?
    options:
        1: Apple
        2: Samsung
        3: Sony
        4: LG
        5: None of these

Codes are integers, never strings. Labels are free-form text (HTML allowed; see Safe HTML).

options works on single, multi, rank, gridSingle (column scale), gridMulti (column scale), and as the row domain on gridSingle/gridMulti/gridNumber/mixGrid/numberList/openList.

options: — referencing a reusable list

Long, reusable option sets live under a top-level - lists: block and are referenced by name.

- lists:
    states:
        options:
            1: Alabama
            2: Alaska
            # ...
            50: Wyoming

- qid: QState
    type: single
    text: In which state are you currently employed?
    options: states

See Defining lists.

options.from — masking the visible domain

A runtime expression that filters options to a subset.

- qid: QBrand
    type: multi
    text: Which brands have you heard of?
    options:
        1: Apple
        2: Samsung
        3: Sony
        4: LG

- qid: QFav
    type: single
    text: Which is your favourite?
    options: brandList     # same authored options as QBrand
    options.from: QBrand.selected

Masked-out options don’t render but still exist in the model. They export as null. See Conditional & dynamic and Tri-state projection.

group — labelled sub-sections of options

Splits the option list into named groups, each with its own header label and order.

- qid: QRole
    type: single
    text: Which best describes your role?
    order: random
    group:
        org1:
            show.label: False
            options:
                1: Lab Director
                2: Lab Manager
        org2:
            show.label: False
            options:
                3: C-Suite
                4: Quality Director
                5: Department Head

group.order: random randomises the groups; order: random randomises the options within each group.

order: on a grouped question is confined per-group — options can never leave their group, so a list like order: [12, 11, 21, 22] orders group A as 12, 11 and group B as 21, 22, never interleaved. group.order: orders the groups themselves. See Order for every form both axes accept.

show.label: False hides the group header (useful when the grouping exists only to control ordering, not as a visual section break).

scale — column dimension on grid types

The columns of a gridSingle, gridMulti, or mixGrid use scale instead of options.

- qid: QSatisf
    type: gridSingle
    text: How satisfied are you with each?
    options:
        1: Service
        2: Price
        3: Reliability
    scale:
        1: Very satisfied
        2: Satisfied
        3: Neutral
        4: Dissatisfied
        5: Very dissatisfied

scale.from masks the visible scale at runtime, parallel to options.from.

Per-entry properties

When you need extra behaviour on a single option / row / scale item, expand it to a map:

specify — attached free-text input

options:
    1: Apple
    2: Samsung
    3: Sony
    4:
        label: Other (please specify)
        specify: True
        anchor: True

The respondent picks the option and types something into the attached field. The text exports as a separate column, <qid>oNSpecify. See Column naming.

anchor — pin in place when shuffling

options:
    1: Apple
    2: Samsung
    3: Sony
    4:
        label: None of these
        anchor: True

order: random shuffles options 1, 2, 3, but 4: None of these stays at the bottom. Anchored items are exempt from order: random and order: randomEach.

exclusive — clears other selections

options:
    1: Apple
    2: Samsung
    3: Sony
    4:
        label: None of these
        exclusive: True
        anchor: True

If the respondent picks 4, options 1, 2, 3 are cleared. Typical “None of the above” behaviour.

exclusive is meaningful on multi, gridMulti, and any other type that supports multiple selections per question or row.

show.label — hide the row / option label

Used inside group: (see above) to hide the group header. Also valid as an entry property to render an unlabelled option (rare).

Putting it together

- qid: QFeatures
    type: multi
    text: Which features matter to you?
    instruction: Select up to three.
    order: random
    max: 3
    options:
        1: Battery life
        2: Camera quality
        3: Screen size
        4: Build quality
        5: Brand reputation
        6: Price
        7:
            label: Other (please specify)
            specify: True
            anchor: True
        8:
            label: None of these
            exclusive: True
            anchor: True

See also