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

At Limesurvey 1.92 we implemented default values for several question types that were missing this feature. In combination with the new and powerful Expression Manager, this offers new possibilities. Using the Expression Manager at Limesurvey 1.92 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:
Limesurvey_text_question-question_code
2. Create a second question of the same type and e.g. ask for the email or last name. Again, note the question code

3. At a third text question, where you want to pre-populate the text field with the previously entered texts, click the “Edit default answers for this question” icon:
Limesurvey edit default answers icon

 

 

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

 

 

5. If you then fill in text for the first two questions, the answers should be inserted at the question for which you defined the default value.

 

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: