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.
- 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
| Property | Values | Notes |
|---|---|---|
qid | string | Required. Unique within the survey. |
type | openList | Required. |
title, text, instruction | renderable | Visible content. Use {{ }} to pipe runtime values. HTML allowed. |
required | True | False | Default True. |
default.errors | True | False | custom string | Default True. |
validation | code block | Python; call fail() to reject. No default. |
readonly | True | False | Default 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. |
visibility | show | hide | Default show. |
order | fixed | random | randomEach | flip | alphabetical | reverse | Default fixed. Row order. |
group.order | same as order | Default fixed. Order of named row groups. |
layout.cols | integer | Default 1. |
label.position | default | left | right | Default is left. Where the row label sits relative to the input. |
min | integer | Minimum number of rows answered. No default. |
max | integer | Maximum number of rows answered. No default. |
exact | integer | Exactly this many rows answered. Overrides min/max. No default. |
options | list name or inline domain | Required when group: is not used. The rows. |
options.from | expression | Filter the visible rows at runtime. No default. |
group | grouped list name | Required when options: is not used. |
input.size | integer | Width of every row’s input field, in characters. No default — sizes itself to the container. |
input.maxChar | integer | Maximum text length any row will accept. No default — unlimited unless set. |
input.minChar | integer | Minimum length for a row to count as answered. No default. |
input.source | default | js | Default default. Set js for JS-fed values. |
custom | code block | Custom runtime block. No default. |
data | object | Metadata 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:
| Property | Values | Notes |
|---|---|---|
options | grouped row entries | Required. |
show.label | True | False | Default True. Set False to hide the group header. |
anchor | True | False | Default 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.
| Property | Values | Notes |
|---|---|---|
label | renderable | Required when expanding the row. |
anchor | True | False | Default False. Pin in place under order: random. |
isolate | True | False | Default False. Render this row in a separate group, outside the main list. Combine with exclusive: True to clear other answered rows when this one is filled. |
exclusive | True | False | Default False. Filling this row clears every other row’s answer. |
- 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 below the main list), exclusive (clear the other rows when
filled), and anchor (always last under order: random).
Methods & accessors
Accessors
Question accessors
| Expression | Returns | Meaning |
|---|---|---|
Q.values | StringList | Collection of all row values, in row order. Empty rows present as "". |
Q.all | CodeSet | Collection of all visible row codes. |
Q.allLabels | LabelList | Collection of row labels, parallel to Q.all. |
Q.answered | bool | True if any row has text. |
Q.notAnswered | bool | Inverse of answered. |
Row accessors
Q.row(N) returns a row proxy with these accessors:
| Expression | Returns | Meaning |
|---|---|---|
Q.row(N).value | str | The text typed in row N. Empty string when unanswered. |
Q.row(N).label | Label | The row’s display label. |
Q.row(N).answered | bool | True once row N has text. |
Q.row(N).notAnswered | bool | Inverse. |
Methods
Question methods
| Expression | Returns | Meaning |
|---|---|---|
Q.set({1: "Tea", 2: "Coffee"}) | None | Set row values from an object keyed by row code. |
Q.set({}) | None | Clear every row. Same as Q.reset(). |
Q.reset() | None | Clear every row. |
Q.row(N) | RowObject | Returns a row proxy for row code N (see Row accessors above). |
Q.at(N) | RowObject | Same 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
| Expression | Returns | Meaning |
|---|---|---|
Q.row(N).set("text") | None | Set row N to a string. |
Q.row(N).reset() | None | Clear row N. |
Collection operations
Q.values, Q.all, and Q.allLabels are collections, so they
support the standard ops:
| Expression | Returns | Meaning |
|---|---|---|
Q.values.size | int | Number of visible rows (the domain size). |
Q.values.at(0) | str | First row’s value, in row order. |
Q.all.size | int | Number of visible row codes — same as Q.values.size. |
Q.all.any(N) | bool | True 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.
QFavourites.answeredFalseQFavourites.valueNoneQFavourites.selected{}QFavourites.selectedLabelNoneQFavourites.selected.size0QFavourites.answeredFalseQFavourites.values{}QFavourites.values.size0QFavourites.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.
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.valuesis a collection of strings, one per visible row, in row order. Empty rows show as"".Q.values.sizeis the row count — the visible domain size, not the count of filled rows. To count filled rows you walkQ.allwithQ.row(c).answered.Q.row(N).valuereads a specific row.Nis the row code (1,2,3here), not a position — same convention as every other row-bearing question type.Q.answeredisTrueas soon as any one row has text. Usemin: Nto 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:
| What | Column |
|---|---|
| Row N text | qidrN (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
- open — single text field.
- numberList — same row shape, but numeric values.
- Row & cell access —
.row(N)semantics. - Layout & input —
input.size,input.maxChar. - Conditional & dynamic —
options.from.