Populating fields from URL

Compatibilità: IdSurvey 6 IdSurvey 7
X

If you are working with external tools, such as panels or CRM, it could be useful to create (or update) contacts complete with values defined in the URL to access the questionnaire.

In order to populate a contact field from URL, you will have to add the following string to the generic link (if the survey is anonymous) or to the univocal link (if the survey is authenticated):

[Link]&field=value

If the “field” is not already present, it will automatically be created as a custom field when the respondent will open the link.

If necessary, you can add more fields and corresponding values by adding more strings “&field=value”. For example, if you need to populate both the field “name” and the field “surname”, the string will be as follows:

https://test.cawi.idsurvey.com/default.cshtml?id=d6e1ffbe-1be4-4fb0-88be-4615d1df032b&name=john&surname=doe

Note

  • You must indicate the standard field with the original name used in the database of IdSurvey (in English and without black spaces). For the complete list please go to the related article.

Authenticated access with primary key in the URL

If you are working with univocal links (authenticated distribution) the respondents will be able to access multiple times and to complete the survey by opening the same link afterwards. When working with external tools (Panels, CRM, etc.) and it is therefore not possible to pre-upload a contact list, you can simulate the same behavior as the univocal link by using the generic link and sending a primary key in the URL. IdSurvey will then check the presence of a contact with the same primary key and, if already existing, it will send the contact back to the corresponding interview.

In order to change the primary key go to the “Link” sections from the CAWI settings. Click on the settings button associated to the link and then on “Change primary key”.

Enter the name of the variable in “URL parameter” box.

Indicate the contact field where to save that information in the “Primary key field”.

Notes

  • Even though the primary key can be used both for anonymous surveys and for authenticated surveys, please remember the different behavior of the two distribution methods. For anonymous distribution, if you don’t already have a contact with the primary key indicated in the URL, IdSurvey will create a new contact. When working with authenticated distribution, if the primary key is not already indicated in the URL, IdSurvey will not allow the access to the interview.
  • For integrations with panels or CRM it can be useful to create a survey with anonymous distribution by using the generic link with the addition of the primary key. In this case you will have to pre-upload a list of fictional contacts containing the primary key value for each contact that can access the interview. The administrator of the external tool will generally provide you with the list of the primary keys of the respondents.
  • We recommend to use random primary keys (or at least non-sequential) in order to avoid that one of the users might manipulate the link to access to the interview started by another respondent.
  • If you are working with multiple panels (or other external tools) you will have to generate multiple links that will open the same questionnaire by clicking on the “+” button below the link. To avoid having duplicated primary keys you have to set a different “Primary key field” for each link that you create.