Insert Values from Survey Participants Table

Insert Values from Survey Participants Table

Insert value from the Survey Participants Table


You can insert values from the survey participants table into your question so that it can show context related information. Think of the participants first name or last name or email address.  For LimeSurvey to do this, the survey needs to be set as:
  1. not anonymous (i.e: tracked) and
  2. it needs to have a survey participants table created.
The following placeholders can be used within a question:

{TOKEN:FIRSTNAME} inserts the value from the "firstname" field located in the survey participants table
{TOKEN:LASTNAME} inserts the value from the "lastname" field located in the survey participants table
{TOKEN:EMAIL} inserts the value from the "email" field located in the survey participants table
{TOKEN:ATTRIBUTE_1} inserts the value from the "attribute_1" field located in the survey participants table
{TOKEN:ATTRIBUTE_2} inserts the value from the "attribute_2" field located in the survey participants table

To use any of the placeholders from above, you must type it/them as written above in the question field text.

For example:
Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}.

If you wish to further customize your questions, use the [[ExpressionScript - Presentation|ExpressionScript]].

For example, if you wish to make use of the tailoring technique, type in: <syntaxhighlight lang="php" enclose="div">What do you as a {TOKEN:ATTRIBUTE_1} think about your {if(TOKEN:ATTRIBUTE_1=='worker','bosses','workers')}?

You may also use JavaScript to achieve further question customization. First, you have to allow JavaScript to be used when setting up questions. This can be achieved by deactivating the XSS filter from the
global settings of your LimeSurvey installation. However, deactivating this option is not always a good idea - read the following wiki section
for further information.

Question tailoring via JavaScript:
Hello {TOKEN:FIRSTNAME}. We sent an email to you using this address {TOKEN:EMAIL}. Is this correct?

What do you as a {TOKEN:ATTRIBUTE_1} think about your <script type="text/javascript" language="Javascript">; var job='{TOKEN:ATTRIBUTE_1}'; if (job=='worker') { document.write ('bosses') } else { document.write('workers') } </script> ?
    • Related Articles

    • Insert Answer from Previous Question

      Insert answers from previous questions LimeSurvey allows you to insert answers from previous questions into the text of a question. You can refer to answers on the same page and even dynamically update tailored messages as responses change on the ...
    • Edit a Question

      Edit a question The following section will explain how to edit a question. Please refer to the Add a question article for details on how to add questions. There are two ways to edit a question - from the Structure tab and from the Settings tab. I. ...
    • Add a Group

      Add group 1. From the survey structure tab of your survey click +Add group. After you click +Add group, the Add question group page will be displayed. 2. Complete the required fields. Add group fields Title: Enter the question group name. ...
    • Question Settings

      Question settings Note: The question settings panel is displayed when you add/edit a question and is located on the right. The settings displayed may vary based on the question type selected. Please refer to the screenshot below for a basic overview ...
    • Overview - STRUCTURE

      Overview - STRUCTURE When you access a survey, the Survey settings menu is selected by default. To access the survey structure, click the Structure tab (next to the Settings tab). Clicking the Structure tab will display: the structure of your survey ...