This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Previous Topic

Next Topic

Book Contents

Book Index

Advanced example: Using one survey to automatically add respondent details to a second survey via an ASP page. WebHost editions only.

This tutorial shows you how to daisy-chain two surveys. For example you might conduct the first survey to ask respondents to join a second feedback survey. Upon submission, the respondent details can automatically be added to the second survey for the purpose of mailing and seeding.

Step 1: Set up the follow-up survey

Start by creating the follow-up survey. This survey needs to be a WebHost survey and needs to have all the questions plus an associated database to hold respondent details and any information needed for the respondent emails.

  1. Create a dummy database that holds all the fields that need to be populated to use for seeding and emailing invitations. The first entry in the database should be a test record that contains your own details.

    The sample database contains seven fields. These will all be supplied by responses to questions in the referring survey.

    Excel spreadsheet showing student database for iterative surveys

  2. Create your survey and add the survey questions in questionnaire design. Add any variables that you will be seeding from the referring survey.
  3. Set up a database link that connects your dummy database to the survey.

    Set the login field and ensure that you have enabled email invitations.

    Create a dummy invitation email including any database fields you wish to use in your final email. You will create the final email on Snap WebHost.

    Address field mapping for database link

  4. Give your database link a recognisable name and save it.
  5. Select the database link in the questionnaire properties and publish the survey.
  6. Upload the published survey to Snap WebHost
  7. Enable database updates and set a password on the survey so you can only make changes to the database if you know the password.
  8. Click [Save] to save your changes and change to the Summary tab.

    surveys page showing kiosk for syn - no responses

  9. Make a note of the survey k number. You will need this and the password to add respondents to the survey database.

    surveys page showing kiosk for syn - no responses

Step 2: Create the referring survey

Create a survey that asks respondents if they would like to join a second feedback survey. They would need to enter their email address and their unique customer number such as a patient number or client reference. Along with any other information you will need to add to the second survey. The information gets added to the second survey by sending it to the updatesurvey.asp page. The ASP page is added as the web address to go to on submission in the first survey.

Step 3: Create the referring survey

You can set up the respondents databases on Snap WebHost using updatesurvey.asp. You do this by creating a web address (URL) that includes a line of text that is sent to updatesurvey.asp . This worksheet shows how to create the following example URL.

https://www.snapsurveys.com/wh/updatesurvey.asp?k=143401250950&kp=blue&a=add&u={Q6}&e={Q6}&m=Surname%3D{Q3}%26Title%3D{Q1}%26Procedure%3D{Q5}&s=PatName%3D{Q2}%26Procedure%3D{Q5}%26PatEmail%3D{Q6}%26PatSurname%3D{Q3}%26Title%3D{V1}%26RecordNum%3D{Q4}&ok=http://www.snapsurveys.com&er=http://www.snapsurveys.com

It looks confusing, but this is partly because you have to use codes instead of the = and & characters when you are passing the information for setting up the emails and seeding the survey. For this part of the text,

you use "%3D" instead of "="

you use" %26" instead of "&"

So %26Title%3D{V1} is equivalent to writing &Title={V1}

What updatesurvey.asp needs to know

What you provide

How to open the survey

the survey k-number and password

 

https://www.snapsurveys.com/wh/updatesurvey.asp?k=143386808119&kp=password

This assumes that the survey k-number is 143386808119 and the password for the survey is password.

What to do (&a)

tell it to add a respondent

&a=add

 

How to uniquely identify the respondent (&u) and provide the email address (&e)

the respondent email address

&u={Q6}&e={Q6}

(this assumes that the email address is in variable Q6 of the referring survey)

 

How to provide information for Snap WebHost email invitations (&m)

the names of the fields in your linked database and the names of the equivalent variables in the first (referring) survey

&m=Surname%3D{Q3}%26Title%3D{Q1}

(This assumes that the database has a field Title and the respondent's title is in Q3 and that the database has a field Surname, and the respondent's surname is in Q4 )

For the text after &m= you use "%3D" instead of "=" and " %26" instead of "&" so this is equivalent to Surname={Q3}&Title={Q1}

How to provide information to seed/pre-load information for the respondent in the scheduled survey (&s)

names of the variables to be seeded/pre-loaded in the second (scheduled) survey and the names of the equivalent variables in the first (referring) survey

&s=%26PatSurname%3D{Q3}%26Title%3D{V1}

(This assumes that the scheduled survey has a variable PatSurname, and the respondent's surname is in Q3 and that the scheduled survey has a field Title and the correct code for the respondent's title is in V1 ). For the part of the text after &s=, you use "%3D" instead of "=" and " %26" instead of "&" so this is equivalent to &PatSurname={Q3}&Title={V1}

 

Where to go after the respondent has been added (&ok and &er)

the address of a website (usually a thank-you page) to go to after the action has completed

&ok=http://www.mythankyoupage.com&er=http://www.mythankyoupage.com

 

(This assumes that you will send respondents to a thank-you page of your choice. If their is a problem, for example they are already in the database, they will still be sent to the same thank-you page unless you specify a different web address after &er)

The response data is always used in when the responses are passed across. If you are passing a coded variable, the code labels will be passed across. If you are seeding into a coded variable, this will be seen as an error. You will therefore need to set up derived coded variables for any coded variables that you are using to seed into the second survey, in which the labels are code numbers, so they will be correctly understood by the receiving survey.

There is a full description of how to set up the codes for updatesurvey.asp in the help at Passing information to the updatesurvey.asp page.

It is best to use a plain text editor to store all this information and write your instruction to updatesurvey.asp. It must be on a single line with no spaces or line breaks.

Once you have created the line, copy it into the Got to on Submit box of the Replies section of the Questionnaire Properties dialog.

Set up the timing on the second survey

Adjust the invitation and reminder email to invite people to take the secondary survey at a specific interval after they have taken the first survey.

Convert the first (invitation) email into an acknowledgement and a notification that they will be sent the details of another survey to complete after seven days, and then make the reminder email the actual invitation to the survey.

You must delete the survey link in the first email.

  1. Open the survey on Snap WebHost. This assumes that you have set up two emails, an invitation (set to go immediately) and a reminder, set to go seven days later.
  2. Go to the Messages tab
  3. Click the Edit link by the first email.
  4. Edit the email so it consists of an acknowledgment that they have completed the first survey and a confirmation that they have signed up for a follow-up survey that they will receive in 7 days. Make sure that you have deleted any links to the survey in the subject or text. You do not want respondents to be able to access it from this email.
  5. Click the Edit link by the second email and edit the email to give them a clear invitation to take part in the scheduled survey. Ensure that you do have a link to the survey in this email.
  6. Check that the schedule is correct.

    surveys page showing kiosk for syn - no responses

Test your survey

It is very easy to make typos when writing out the command for the updatesurvey.asp. It is therefore very important that you check every single assignment is correct before you do anything further.

  1. Open the first (referring) survey and click the test link.
  2. Complete the survey for a test respondent and submit it. Confirm that you are directed to the correct page (whatever site you entered at &ok=http://www.mythankyoupage.com&er=http://www.mythankyoupage.com) when you submit.
  3. Open the second (scheduled) survey and click the Respondents tab.
  4. Confirm that your new respondent has been added correctly. Click on the respondent's name to see what information is held in the Snap WebHost database for emailing that survey (what you put in the &m= part of the text)
  5. Complete a test survey for the respondent that you have just added and submit it.
  6. Go to the Summary tab and click on the link Download test case. Confirm that the downloaded file has the correct seeded data in it. (Import it into Snap and look at it there or look at the text file and confirm that the data is present, even if the variable numbers are unexpected).
  7. Start the survey and confirm that the emails are sent to the added respondent at the correct interval.

You can reload the second (scheduled) survey without affecting the assignment text used in the first survey, but if you make changes and upload it as a new survey, you will have changed the k-number, so will need to change the assignment text.

See Also

Setting what happens when the participant submits a questionnaire in Snap WebHost

Using survey variables to specify the website that a participant goes to when they finish

Example: using a variable label to specify a website to go to on submit