Piping: use answers from previous questions
Piping puts an earlier answer into a later text, for example "What do you like most about your Laptop?" after a participant chose Laptop. You insert a placeholder with the question code in curly brackets, and LimeSurvey replaces it with the answer while the survey runs.
Insert an earlier answer
In the new editor
- Click the text of a later question where the answer should appear.
- In the toolbar above the text, click the ⋮ button (1) and point to Placeholder fields (2).
- Under Fields based on previous answers (3), click the question. LimeSurvey inserts a placeholder such as
{Q001.shown}at the cursor. - Preview the survey with Preview survey (the eye icon in the top bar), answer the earlier question and check the text.

The list of earlier answers is offered in question texts. In other texts, such as the help text of a question or the end screen, type the placeholder yourself.
In the classic editor
- Open the question and click Edit.
- In the toolbar of the question text, click Placeholder fields (the { } button).
- Under Previous answer fields, select the question and click OK. LimeSurvey inserts a placeholder such as
{Alcohol.shown}. - Click Save.

When the survey shows all questions on one page (All in one), the classic dialog only offers answers from earlier pages. You can still type the placeholder yourself.
Answer code or answer text
{Q001.shown} shows the answer the way the participant saw it, for example Laptop. {Q001} gives the answer code instead, for example A002. For text and number questions both give what the participant typed.
You can also type a placeholder yourself. The question must come before the text that uses it, and codes are case-sensitive. See Regenerate question codes.
Insert participant and survey data
The same menu inserts data that is not an answer:
- Participant email address, Participant first name and Participant last name (in the classic editor: Participant - Email address, Participant - First name, Participant - Last name) come from the participant list. Your own participant attributes are listed as Participant attribute: .... These fields stay empty for participants who open the survey through a public link.
- Question ID, Question group ID, Survey ID and Survey expiration date come from the survey.
Vary the text
A placeholder can hold an expression. {if(Q001 == "A002", "laptop", "phone")} shows "laptop" to participants who chose the answer with the code A002 and "phone" to everyone else. See ExpressionScript Engine - Quick start guide.
FAQ
Why does my survey show {Q001} instead of the answer?
The code in the placeholder does not match a question before this text. Check the spelling and the upper and lower case of the code, and that the question comes earlier in the survey.
How do I greet invited participants by name?
Use Placeholder fields ⇒ Participant first name (classic editor: Participant - First name). It inserts {TOKEN:FIRSTNAME}. It is filled for participants you invite from the participant list, and empty for everyone who uses a public link.