then
Experiments Surveys & forms
then lists the destinations executed when the paired if conditions match (or unconditionally when there is no if). It is the master switch for a trial’s conditional logic: a row’s conditions are only checked when its then cell is filled in. Use it to jump to rows or labels, repeat trials, end the experiment, screen participants out, start a break timer, or redirect to an external URL.
Syntax
Section titled “Syntax”Put a single destination in the cell, for example then="10" to jump to trial-file row 10 or then="practice_start" to jump to a labeled row. On its own, that destination is taken every time the trial runs.
To branch, list several destinations separated by ; and write the matching conditions in the paired if cell. They pair up in order: destination 1 with condition 1, destination 2 with condition 2, and so on.
You may add one destination more than there are conditions. It acts as an “otherwise” and is taken when no condition matched. Any further extras are ignored.
Options
Section titled “Options”| Destination | Effect |
|---|---|
0 | Repeat the current trial |
positive integer N | Jump to trial-file row N, where the header is row 1 and the first trial is row 2. If that row is not part of this participant’s trial order (because of randomization or subject groups), the experiment ends |
+N / -N | Move N positions forward or backward in the order the participant actually sees; moving past either end ends the experiment |
end (case-insensitive) | Ends the experiment |
screenout | Marks the participant as screened out (only when the project has screenout configured, and never in preview), then continues; the screenout screen appears at the start of the next trial |
timer:start | Starts the timed-break clock and continues to the next trial. Its presence also makes every time-based break wait for it |
http://... / https://... | Sends the participant to that address. %%url_x%% placeholders are filled from the study’s own query parameters, %var% references are replaced, the current query parameters are appended, and the experiment stops there |
| any other string | Jump to the first trial row carrying that label. A label whose row is not in this participant’s order ends the experiment; an unknown label continues to the next trial |
Defaults & missing values
Section titled “Defaults & missing values”Leave the cell empty on every row that should simply carry on to the next trial. On the last row of the file, an empty then is also what lets the experiment finish.
thenfilled in with noifon the row: the first destination is taken every time.thenfilled in but no condition matched: the participant continues with the next trial.- Spaces around each destination are ignored.
Works with
Section titled “Works with”- if: conditions and destinations pair up in order, and the first true condition decides where the participant goes. See the
ifpage for the condition grammar. - End of the experiment: the last row does not finish the experiment when its
thenis filled in, which is what lets you jump backwards from the final row. - Screening: any
thencell containingscreenoutmarks the project as having a screening section. Screening progress is tracked from the screenout rows the participant actually reaches: they count as having passed screening once at least one screenout row has been shown, they were not screened out, and no screenout row is still ahead of them. - break: a
breakrow’sthenruns when the break ends, and a last row withbreakset also keeps the experiment from finishing. - Setup screens: destinations only take effect after a regular trial, never after consent, calibration or participant-details screens.
- staircase: when no destination fires,
staircasedecides the next row.
Examples
Section titled “Examples”Screen out non-consenting participants, otherwise continue:
| type | trialText | keyboard | if | then |
|---|---|---|---|---|
| test | Are you over 18? (y/n) | y n | n | screenout |
type,trialText,keyboard,if,then test,Are you over 18? (y/n),y n,n,screenout
Three-way branch plus fallback (b→row 10, c→label, anything else→end):
| type | trialText | keyboard | if | then |
|---|---|---|---|---|
| test | Pick a b or c | a b c | b;c | 10;section_c;end |
type,trialText,keyboard,if,then test,Pick a b or c,a b c,b;c,10;section_c;end
Redirect to an external survey at a decision point:
| type | trialText | keyboard | if | then |
|---|---|---|---|---|
| test | Done. Press space | space | space | https://example.com/exit?pid=%%url_pid%% |
type,trialText,keyboard,if,then test,Done. Press space,space,space,https://example.com/exit?pid=%%url_pid%%
Tips & gotchas
Section titled “Tips & gotchas”- A misspelled label is indistinguishable from “no jump”: the participant continues with the next trial and nothing warns you.
- Any destination containing the word
timeris treated as a break-clock action, and onlytimer:startactually does something. Othertimer...spellings do nothing at best and stop the experiment from starting at worst, so write it exactly. then="-0", and any other destination with a sign in front, is a relative move rather than a row number.
Common combinations
Section titled “Common combinations”then appears in these worked recipes:
- Skip on response: Ask one question and jump participants who answer yes straight past the practice block.
- Accuracy-gated progression: Let participants advance to the test block only once their practice accuracy clears a threshold.
- Branching questionnaire: Route participants to different questionnaire pages depending on their answer to an earlier question.
- Screener then branch: Ask one eligibility question up front and end the session for participants who do not qualify.