Reusable lists

Groups

`group:` lets a list carry sub-headings or sub-bands when options fall into natural categories. Either show the headings, hide them while keeping the bands intact, or anchor a sub-group to a fixed position. Defined inside the same `- lists:` block as flat options.

When a flat options: isn’t enough

Most questions are happy with a flat list. Reach for group: when one of these is true:

  • Visible sub-headings. Long lists scan faster when grouped under category labels (e.g. Streaming services / Cable channels).
  • Hidden sub-bands. With show.label: False, the headers don’t render — but the options inside each sub-group stay together. Combined with order: random, this lets you shuffle options inside each band while keeping the bands in a fixed order. Useful for cognitive bias control across topical clusters.
  • Anchor a sub-group. A whole sub-group can be pinned in place under group.order: random — handy when one band (“Other” or “None of the above”) must always be last.

This page covers the deeper patterns. For the basic case (a shared flat list) and the rules for declaring lists in general, see Defining lists.

Group basics — visible sub-headings

The simplest case: each sub-group has a name that renders as a section heading, and a list of options. show.label: True is the default, so it can be omitted.

- qid: QStores
    type: multi
    text: Which stores have you shopped at in the last month?
    group: groceryStores

# at the bottom
- lists:
    groceryStores:
        group:
            Grocery Stores:
                options:
                    11: Aldi
                    12: Kroger
                    13: Whole Foods
            Warehouse Clubs:
                options:
                    21: Costco
                    22: Sam's Club
            Mass Retail:
                options:
                    31: Target
                    32: Walmart Supercenter

The respondent sees three section headers in order, each followed by its options.

Hidden labels — keep options grouped without showing headers

show.label: False hides the sub-group’s name but keeps the options together. This is a common randomization-control pattern: shuffle within each sub-group while keeping the sub-groups in a fixed sequence.

- qid: QStreaming
    type: multi
    text: Which kinds of content do you watch on streaming services?
    order: random
    group: streamingContent

- lists:
    streamingContent:
        group:
            gr1:
                show.label: False
                options:
                    1: Movies
                    2: TV series and dramas
                    3: Comedy specials
                    4: Documentaries
            gr2:
                show.label: False
                options:
                    5: Live sports
                    6: Sports highlights and analysis
                    7: Live news
                    8: Talk shows
            gr3:
                show.label: False
                options:
                    9: Kids' shows
                    10: Animated series
                    11: Cooking and lifestyle
                    12: Reality TV
                    13:
                        label: None of the above
                        exclusive: True
                        anchor: True

What the respondent sees: a single flat list with the gr1 options shuffled, then the gr2 options shuffled, then the gr3 options shuffled — never a gr2 option appearing among gr1 items. The category boundaries stay invisible but structurally enforced. The “None of the above” option in gr3 anchors to the very bottom and clears any other selections when picked.

The group names (gr1, gr2, gr3) are arbitrary internal labels — pick whatever names help your team navigate the YAML.

Anchoring a sub-group

Under group.order: random (which shuffles the order of the sub-groups themselves), a sub-group with anchor: True stays put.

- qid: QFavCategory
    type: single
    text: Which type of store do you visit most often?
    group: groceryStores
    group.order: random

- lists:
    groceryStores:
        group:
            Grocery Stores:
                options:
                    11: Aldi
                    12: Kroger
            Warehouse Clubs:
                options:
                    21: Costco
                    22: Sam's Club
            Other:
                anchor: True
                options:
                    97:
                        label: Other (please specify)
                        specify: True

group.order: random shuffles Grocery Stores and Warehouse Clubs between respondents; Other always sits at the bottom.

Two-level ordering

Property on the questionAffects
group.orderOrder of the sub-groups (the section headers / bands).
orderOrder of options within each sub-group.

Set both for full randomization while keeping option-to-band membership intact:

- qid: QStores
    type: multi
    text: Which have you visited?
    group: groceryStores
    group.order: random   # sub-groups shuffle
    order: random         # options inside each sub-group shuffle

A sub-group with anchor: True is exempt from group.order: random; an option with anchor: True is exempt from order: random.

Group inside a grid

Grids can use group: for the row dimension while scale: provides the columns. Each sub-group acts as a band of related rows, with show.label: False hiding the band name but keeping the rows together.

- qid: QShoppingExperience
    type: gridSingle
    text: How satisfied were you with each part of your last online order?
    order: random
    scale.repeat: both
    scale.repeat.every: 6
    scale:
        1: Very dissatisfied
        2: Dissatisfied
        3: Neutral
        4: Satisfied
        5: Very satisfied
    group: shoppingJourney

- lists:
    shoppingJourney:
        group:
            browsing:
                show.label: False
                options:
                    1: Finding what you wanted on the homepage
                    2: Search results matching what you were looking for
                    3: Product photos and detail pages
            checkout:
                show.label: False
                options:
                    4: Cart and saved-items handling
                    5: Payment options offered
                    6: Speed of checkout from cart to confirmation
            delivery:
                show.label: False
                options:
                    7: Delivery cost shown at checkout
                    8: Estimated delivery date accuracy
                    9: Tracking updates after the order shipped
                    10: Condition of items on arrival
            aftercare:
                show.label: False
                options:
                    11: Return process if you needed one
                    12: Customer support responsiveness
                    13:
                        label: Other part of the experience (please specify)
                        specify: True
                        anchor: True

What the respondent sees: a single grid with all rows shuffled within their bands, the 1–5 satisfaction scale running across the top, and the header repeating every 6 rows top and bottom (see gridSingle for the scale.repeat details).

Per-group properties

PropertyValuesNotes
show.labelTrue | FalseDefault True. Show or hide the sub-group’s name as a section header.
anchorTrue | FalseDefault False. Pin in place under group.order: random.
optionsinline coded listRequired. The options that belong to this sub-group.

Per-option properties (label, specify, anchor, exclusive) work inside a group exactly the same way they do inside a flat options: list.

See also

  • Defining lists — how to declare and reference all three list kinds, including scale: for grids
  • single, multi, rank — typical consumers of group:
  • gridSingle, gridMulti — consume both group: (rows) and scale: (columns)
  • Masking — options.from for runtime-driven option lists