How to Pass Data from URL to a Survey
The variables offer a quick method for pre-populating existing data into a survey. For example, by adding a simple query link to the end of a survey, you can ensure all relevant data will be collected for each response. This feature, therefore, allows you to push data into your survey via the survey link.
Add a custom URL variable
- On the Dashboard page, click on the Edit link for your survey.
- Click on the Advanced Options link from the header menu. Then click on the Variables link.
- Enter a URL variable name.
- Enter the default value as needed.
- Click on the Save button.
Pass data from URL to question title
- Navigate to the question that you wish to pass data in.
- Insert a variable surrounding by double "curly" brackets, such as {{city}}, in the question title or text.
In your survey URL, you can add a parameter at the end, such as "?city=Paris". This allows the question to replace the variable with the parameter value in the URL.
Pass data from URL to a choice
- Navigate to the choice that you wish to pass data in.
- Insert a variable surrounding by double "curly" brackets, such as {{todayspick}}, in the choice.
In your survey URL, you can add a parameter at the end, such as "?todayspick =Pineapple". This allows the question to replace the variable with the parameter value in the URL.
It should be noted that this feature applies to choices in Multiple Choice, Dropdown, Grid - Multiple Choice, and Grid - Dropdown questions.
Pass data from URL as an answer
In your survey URL, you can add a parameter at the end, such as "?Q1=Tom". This allows the survey to pre-enter the answer for a question with the parameter value in the URL. The parameter variable name starts with "Q" (case insensitive) followed by the index number of the question.
Please be noted that:
- This feature applies to Multiple Choice (Single-select), Dropdown, NPS, Star Rating, Scale, Slider, Textbox, and Comment Box questions.
- If your data contain special characters, please use URL encoded characters in the URL. For example, "?Q1=Tom%20Smith" will put "Tom Smith" as the answer.
Assign a default value for a URL parameter
If your survey expects to receive data from the URL, but the URL doesn't contain a value for the specified parameter, the variable with double "curly" brackets in your survey element will be replaced with an empty string unless you added a custom URL Variable with a default value.
Search for articles: