Dynamically changing the website shown on submit

When participants complete the online questionnaire, they can be taken to a specified website. The website address specified can include one or more survey variables. These can be a question response inserted into part of a website address or can be a derived variable, which identifies all or part of a website address, that is chosen dependent on the participant’s answers.

This tutorial uses Snap XMP Desktop to show how to use a single choice question and a derived variable to create a web address works.

The data that is inserted in place of the question name depends on the type of question:

Response typeInformation used
Quantity, Date, Time or Literal responseParticipant’s answer
Single responseCode label
Multiple responseThe response code labels are joined into a comma separated list

Step 1: Setting up the question

  1. In the Survey Overview window, open the survey in the Questionnaire window.
  2. Click New Question NewIcon.png to add a question and select Single Choice from the option list.
  3. Enter the question text.
  4. Press Tab to create the different choices and complete the code labels. In the example, the choices are four areas that you can visit on the Snap Surveys website. The answer chosen by the participant is used to determine the web page shown after completing the questionnaire.
Single Choice question
  1. Select Response in the Toolbar Topic menu, and select Single response.
  2. Click Save SaveIcon.png to save your changes.

Step 2: Creating the derived variable

  1. Click Variables VariablesIcon.png on the main toolbar to open the Variables window.
  2. Click New Variable NewIcon.png to create a new variable.
  3. Set the variable properties
    • Name: WebPage
    • Label: Web address section
    • Type: Derived
    • Response: Single
  4. Add the code list to return the label used to create the web address dependant on the answer given by the participant. In the example, the label ‘services’ is returned when the answer ‘Research services’ is selected.
Derived variable to set the web page

Step 3: Setting the On Submit web page

  1. In the Questionnaire window, click Questionnaire properties QuestionnairePropsIcon.png
  2. In Section, select Submit.
  3. In On Submit, select Web page.
Questionnaire properties showing the custom web page
  1. Type the full web address https://www.snapsurveys.com/{WebPage} into the text box. The variable name must be enclosed in curly brackets. When ‘Research services’ is selected the web page shown after the participant submits their response will be https://www.snapsurveys.com/services.
  2. Click Save SaveIcon.png to save your changes

Step 4: Publishing and testing the questionnaire

  1. Click Publish to open the Publish Questionnaire dialog.
  2. In Method, select Publish with preview.
  3. Click Publish to publish the survey.
  4. In the web browser go through all the questions, and check that when the correct web page is displayed after the questionnaire is submitted.

Alternatively you can publish in Snap XMP Online.

  1. Log in to Snap XMP Online and select your survey in Your Work.
  2. In Summary, click the Collect link.
  3. Click Publish current version to publish the survey.
  4. Click Launch preview to test the questionnaire, and check that when the correct web page is displayed after the questionnaire is submitted.

If there is a topic you would like a tutorial on, email to snapideas@snapsurveys.com

Contents