Skip to content

Text Expressions

A text expression is a {{ }} token in survey text. VeySur evaluates it per participant and replaces it with the result.

The welcome message, group names and descriptions, question text and detail, subquestion text, answer option labels, and the thank-you message. A field may hold more than one token.

Expressions use the same roots as conditions, plus two specific to text.

RootRefers to
answers.<QuestionCode>An earlier answer’s raw stored value, for calculations
answerLabels.<QuestionCode>The same answer as readable text; empty when unanswered
labels.<Code>Static text: a question, group, row, or option label
participant.<name>A built-in field or a custom attribute
response.languageThe language currently being viewed

See Variable Paths for addressing matrix cells, multi-part parts, and options.

Arithmetic, comparisons, the ternary operator (? :), and && || !. Strings support .includes(), .toLowerCase(), .toUpperCase(), .trim(), .length; arrays support .includes() and .length. Nothing else.

answers.* and answerLabels.* can only reference a question before the field they are in (the thank-you message is exempt; the welcome message can reference no answers). labels.* has no such restriction. An unsafe or unresolvable expression is left as plain text; check Preview to confirm every token resolves.

Hi {{participant.nameFirst}}, thanks for your time.
{{participant.city === "Liverpool" ? "As a local, " : ""}}what did you think?
For "{{labels.Q005}}" you chose {{answerLabels.Q005}}.
← www.veysur.comcore 33b7dee · cloud d5d0cf7e