Question type

openList

A list of free-text inputs, one per row. Use when the respondent should enter several short text values against a known set of items.

What openList is

openList shows a labelled row for each option, with a free-text input beside each one. The respondent can fill some, all, or none of the rows (subject to min / max / exact). Each row has its own input constraints.

Mockup preview
QExamples openlist
Give one example of each.
All three required.
- qid: QExamples
    type: openList
    text: Give one example of each.
    instruction: All three required.
    exact: 3
    options:
        1: A movie you watched recently
        2: A book you read recently
        3: A podcast you listened to recently

Properties

PropertyValuesNotes
qidstringRequired. Unique within the survey.
typeopenListRequired.
title, text, instructionrenderableVisible content. Use {{ }} to pipe runtime values. HTML allowed.
requiredTrue | FalseDefault True.
default.errorsTrue | False | custom stringDefault True.
validationcode blockPython; call fail() to reject. No default.
readonlyTrue | FalseDefault False. Set True to render the question but disable input — the respondent sees the rows but can’t change the values. Pair with visibility: hide to fully hide a helper question.
visibilityshow | hideDefault show.
orderkeyword or expressionRow order. Keywords: fixed (default), random, randomEach, alphabetical, reverse, flip. Also accepts an expression that resolves to an ordered code list (e.g. Q1.all, hOrder.rows). See Order.
group.ordersame as orderDefault fixed. Order of named row groups.
layout.colsintegerDefault 1.
label.positiondefault | left | rightDefault is left. Where the row label sits relative to the input.
minintegerMinimum number of rows answered. No default.
maxintegerMaximum number of rows answered. No default.
exactintegerExactly this many rows answered. Overrides min/max. No default.
optionslist name or inline domainRequired when group: is not used. The rows.
options.fromexpressionFilter the visible rows at runtime. No default.
groupgrouped list nameRequired when options: is not used.
input.sizeintegerWidth of every row’s input field, in characters. No default — sizes itself to the container.
input.maxCharintegerMaximum text length any row will accept. No default — unlimited unless set.
input.minCharintegerMinimum length for a row to count as answered. No default.
input.sourcedefault | jsDefault default. Set js for JS-fed values.
customcode blockCustom runtime block. No default.
dataobjectMetadata object for advanced authoring (custom code can read it). No default.
min / max / exact count rows answered, not characters. An “answered” row is one with at least one character of text. Use input.maxChar for length caps within a single input.

Group properties

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

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

Per-row properties

Expand a row to a map to attach extra behaviour to that row alone.

PropertyValuesNotes
labelrenderableRequired when expanding the row.
anchorTrue | FalseDefault False. Pin in place under order: random.
isolateTrue | FalseDefault False. Renders this row as a whole-question opt-out toggle below the main list — a “None of these / Prefer not to answer” checkbox. Pair with exclusive: True.
exclusiveTrue | FalseDefault False. When set alongside isolate: True, selecting the opt-out clears + disables every other row’s input and satisfies required — the server nulls the main answer and the respondent can proceed.
- qid: QExamples
    type: openList
    text: Give one example of each.
    options:
        1: A movie you watched recently
        2: A book you read recently
        3: A podcast you listened to recently
        99:
            label: Not applicable
            isolate: True
            exclusive: True
            anchor: True

The first three rows are plain string labels — no extra behaviour needed. The fourth row expands to a map so it can carry isolate (render as a “None of these” toggle below the main list), exclusive (clear + disable every input on the client and null the main answer on the server, satisfying required), and anchor (always last under order: random).

The export records the opt-out as a single flag column QExamplesr99 = 1; every regular row column (QExamplesr1, QExamplesr2, QExamplesr3) reads null on that respondent’s row. See Tri-state projection.

Methods & accessors

Accessors

Question accessors

ExpressionReturnsMeaning
Q.valuesStringListCollection of all row values, in row order. Empty rows present as "".
Q.allCodeSetCollection of all visible row codes.
Q.allLabelsLabelListCollection of row labels, parallel to Q.all.
Q.answeredboolTrue if any row has text.
Q.notAnsweredboolInverse of answered.

Row accessors

Q.row(N) returns a row proxy with these accessors:

ExpressionReturnsMeaning
Q.row(N).valuestrThe text typed in row N. Empty string when unanswered.
Q.row(N).labelLabelThe row’s display label.
Q.row(N).answeredboolTrue once row N has text.
Q.row(N).notAnsweredboolInverse.

Methods

Question methods

ExpressionReturnsMeaning
Q.set({1: "Tea", 2: "Coffee"})NoneSet row values from an object keyed by row code.
Q.set({})NoneClear every row. Same as Q.reset().
Q.reset()NoneClear every row.
Q.row(N)RowObjectReturns a row proxy for row code N (see Row accessors above).
Q.at(N)RowObjectSame as Q.row(N).

openList.set() only accepts an object keyed by numeric row code, with string values. Unknown row codes throw; non-string values throw.

Row methods

ExpressionReturnsMeaning
Q.row(N).set("text")NoneSet row N to a string.
Q.row(N).reset()NoneClear row N.

Collection operations

Q.values, Q.all, and Q.allLabels are collections, so they support the standard ops:

ExpressionReturnsMeaning
Q.values.sizeintNumber of visible rows (the domain size).
Q.values.at(0)strFirst row’s value, in row order.
Q.all.sizeintNumber of visible row codes — same as Q.values.size.
Q.all.any(N)boolTrue if row code N is in the visible domain.

For “how many rows are filled?” use a script: sum(1 for c in Q.all if Q.row(c).answered). This isn’t a single accessor — open-text answer counts depend on the runtime walking each row.

See it work

Type into one or more rows and watch the Live state panel.

Mockup preview
QFavourites openlist
What are some of your favourite things?
Live state
QFavourites.answeredFalse
QFavourites.valueNone
QFavourites.selected{}
QFavourites.selectedLabelNone
QFavourites.selected.size0
Live state
QFavourites.answeredFalse
QFavourites.values{}
QFavourites.values.size0
QFavourites.all.size0
- qid: QFavourites
    type: openList
    text: What are some of your favourite things?
    options:
        1: Favourite movie
        2: Favourite book
        3: Favourite band
        4: Favourite hobby

Methods & accessors — live

Type into rows below and watch each expression evaluate.

Mockup preview
QFavourites openlist
Tell us about your favourites.
Methods & accessors — live
QFavourites.answered → —
QFavourites.values → —
QFavourites.values.size → —
QFavourites.all.size → —
QFavourites.row(1).value → —
QFavourites.row(2).value → —
QFavourites.row(1).label → —
QFavourites.row(1).answered → —
len(QFavourites.row(1).value) → —

A few things to notice:

  • Q.values is a collection of strings, one per visible row, in row order. Empty rows show as "".
  • Q.values.size is the row count — the visible domain size, not the count of filled rows. To count filled rows you walk Q.all with Q.row(c).answered.
  • Q.row(N).value reads a specific row. N is the row code (1, 2, 3 here), not a position — same convention as every other row-bearing question type.
  • Q.answered is True as soon as any one row has text. Use min: N to require a minimum number of filled rows.

Examples

Three required favourites

- qid: QFavourites
    type: openList
    text: Tell us three of your favourites.
    exact: 3
    options:
        1: Favourite movie
        2: Favourite book
        3: Favourite hobby

exact: 3 requires every row to be filled. Without it, the respondent could leave some blank.

Up to N comments

- qid: QImprovements
    type: openList
    text: List up to 5 things you'd improve.
    max: 5
    options:
        1: First idea
        2: Second idea
        3: Third idea
        4: Fourth idea
        5: Fifth idea

Row domain from a previous answer

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

- qid: QBrandWhy
    type: openList
    text: For each, why do you use it?
    options: brandList
    options.from: QBrand.selected

The openList only shows rows for brands the respondent picked at QBrand. Each surviving row gets its own text input.

Pipe a row’s value

- qid: QAccount
    type: openList
    text: Account details.
    options:
        1: Username
        2: Display name

- qid: QConfirm
    type: info
    text: We've created the account for {{ QAccount.row(1).value }}.

Q.row(N).value is pipe-able like any other accessor.

Validation — every filled row meets a minimum length

- qid: QExamples
    type: openList
    text: Give one example of each.
    options:
        1: A movie
        2: A book
        3: A podcast
    validation: |
        for code in QExamples.all:
            row = QExamples.row(code)
            if row.answered and len(row.value.strip()) < 3:
                fail("Each example needs at least 3 characters.")
                break

Walk QExamples.all to visit every visible row code. The check fires only on rows that are actually filled — empty rows are left to the required: / min: rules.

At least one row filled

- qid: QFeedback
    type: openList
    text: Tell us about anything you'd like.
    required: False
    min: 1
    options:
        1: What you liked
        2: What you didn't
        3: Suggestions

required: False lets the respondent skip the question. min: 1 says: if you do answer, fill at least one row.

Hidden helper that combines row values

- qid: hCombined
    type: open
    visibility: hide
    readonly: True
    required: False

- script: |
    parts = [QFavourites.row(c).value
             for c in QFavourites.all
             if QFavourites.row(c).answered]
    hCombined.set(" / ".join(parts))

hCombined ends up holding a single concatenated string of all filled rows — useful when downstream analysis wants one column instead of three.

Export

openList exports one column per row:

WhatColumn
Row N textqidrN (e.g. QExamplesr1, QExamplesr2) — string

Empty rows export as an empty string "". Masked rows (filtered out by options.from) export as null — different meaning. See Tri-state projection.

See also