Getting started

Quick start

A five-minute tour from a blank file to a working preview. Covers a single, a multi, conditional routing, a hidden helper, and a script.

Goal

By the end of this page the survey screens a respondent on age, asks them about brand awareness, terminates the unqualified, and routes the rest to a follow-up. Every concept used here is documented in detail elsewhere — this page just shows them in one place.

Indentation rule: properties under - qid: indent by four spaces, not two. The parser is strict about this. All examples in this manual follow that convention.

The whole survey

# Screener for a hypothetical electronics study.

- qid: QAge
    type: number
    text: How old are you?
    label.suffix: years
    input.size: 4
    min: 13
    max: 120

- script: |
    if QAge.value < 18:
        endSurvey("terminate")
        redirectUrl("https://example.com/thanks")

- qid: QBrand
    type: multi
    text: Which of these brands have you heard of?
    instruction: Select all that apply.
    order: random
    options:
        1: Apple
        2: Samsung
        3: Sony
        4: LG
        5:
            label: None of these
            anchor: True
            exclusive: True

- script: |
    if QBrand.selected.any(5) or QBrand.selected.size == 0:
        endSurvey("terminate")
        redirectUrl("https://example.com/thanks")

- qid: QFav
    type: single
    text: Which of these is your favourite?
    options.from: QBrand.selected

That’s a complete, parseable survey. Drop it into the editor, hit preview, and answer your way through it.

What just happened, line by line

QAge — a number question

A single numeric input. min and max enforce a sensible range — the preview refuses values outside this band. label.suffix adds “years” to the right of the input. input.size sizes the box for a short value.

A script block

- script: |
    if QAge.value < 18:
        endSurvey("terminate")
        redirectUrl("...")

- script: | introduces a Python block. Anything indented under it is Python until the next top-level block. QAge.value is the respondent’s answer to QAge. endSurvey() is a built-in that ends the survey with a status code; the optional redirect sends the respondent to a URL.

QBrand — a multi

A multi-answer question. order: random shuffles the options each time the question is rendered, so respondents don’t see the same brands in the same order. Code 5 (“None of these”) is anchored (pinned in place, never shuffled) and exclusive (selecting it clears the others).

Terminating on logical inconsistencies

- script: |
    if QBrand.selected.any(5) or QBrand.selected.size == 0:
        endSurvey("terminate")
        redirectUrl("...")

QBrand.selected is a collection of the codes the respondent picked. .any(5) is True if code 5 is in the collection. .size is how many are selected. Together this terminates anyone who said “None” — they’re out of scope — and anyone who somehow managed to leave the question blank (defensive).

QFav — masked options

- qid: QFav
    type: single
    options.from: QBrand.selected

options.from masks the option list using a runtime expression. QFav shows only the brands the respondent selected at QBrand. There’s no need to author the option list twice — the masking machinery does it.

Running it

The editor’s preview pane renders the survey live as a respondent would see it. The “test-assist” toggle simulates answers so iterating on routing doesn’t require manually clicking through every step.

  • Core concepts — the mental model behind questions, proxies, collections, and loops. Worth reading once before going further.
  • Question types — the catalogue. Each type has its own page.
  • Runtime & expressions — how to write conditions and pipe values in Python.
  • Export & data — what the data file looks like.