Skip to content

Use Expressions in Survey Text

Survey text can reference an earlier answer or a participant detail, so a question or message reads as though written for each participant.

The welcome message, group names and descriptions, question text and detail, subquestion text, answer option labels, and the thank-you message accept {{ }} tokens.

In the survey editor, click into the text field where the value should appear.

Click Insert variable in the text toolbar. The picker groups variables under Participant, Response, Answers (raw values), Answer labels (readable answers) and Survey labels (static text). Selecting one inserts a wrapped {{ }} token at the cursor.

A token can also be typed directly. Once recognised, it is shown as a pill, so it is clear it will be evaluated rather than shown literally.

A token can hold a full JavaScript expression, for example to vary wording by an earlier answer:

{{participant.city === "Liverpool" ? "As a local, " : ""}}what did you think?

To show an answer back as prose, use answerLabels not answers: You chose {{answerLabels.Q005}}. renders the option label; {{answers.Q005}} shows the raw value.

See Text Expressions for variables and operations, and Variable Paths for matrix and multi-part paths.

Open the Preview tab and answer any question the expression depends on. Confirm the rendered text shows the expected value, not the token.

answers.* and answerLabels.* can only reference an earlier question (the thank-you message may reference any); labels.* and the welcome message have no such limit. An invalid or unresolvable expression is left as literal {{ }} text, not an error.

← www.veysur.comcore 33b7dee · cloud d5d0cf7e