Pre-filling a text field at Limesurvey using default answers and Expression Manager

Limesurvey comes with a feature to set default values for several question types. In combination with the powerful Expression Manager this offers new possibilities. Using the Expression Manager you can now easily populate a text field with data from previous answers.

Let’s create a simple example for demonstrating how it works:

1. Create a text question at Limesurvey and note the question code:
Screenshot showing question setup
2. Create a second question of the same type and e.g. ask for the email. Again, note the question code.

3. At a third text question we want to pre-populate the text field with the previously entered texts. To set this up click the “Edit default answers” option at the question tree.

4. At the field to enter a default value add the question codes in {…} brackets:

Screenshot showing configuration of placeholdrs

5. If you then fill in text for the first two questions the answers will be pre-populated at the third question:

Screenshot of pre-populated question

You can test with this demo survey.

The design used for the demo survey can be downloaded at our shop.

Things to watch out for:

  • The question for which you set the default answer has to be shown on a following page.
  • When setting a default value use {…} brackets when referring to a question code of a previous question.

More Information: