Online Survey Tutorials
SurveyGizmo Tutorials and Help Documentation
Table of Contents
Tutorial: Pushing Values into the Survey: Part 2
This is the continuation of the series for pushing values into your survey through the query string. Make sure to check out Part 1:Query String Basics, if you want to get the background on what the query string is, how it’s displayed within the responses, and basic structure and syntax.
As a general note, to have the survey display the value associated with a variable sent through the query string, SurveyGizmo uses the following merge code:
[%%GET_xxx]
Where xxx represents the variable name. Therefore, given the query string:
?userid=123
To capture the value of ‘123′ within SurveyGizmo, the merge code would be:
[%%GET_userid]
This will be used in various ways throughout the rest of this part of the tutorial.
Storing Query String Values in Hidden Value Actions
As discussed in Part 1:Query String Basics, SurveyGizmo will capture information passed through the query string and make it available in ‘browse responses’ or the ‘export to text’ option automatically. However, in some cases, you may prefer to store the query string value so it can be compared within, for instance, a Summary Report.
In other cases, you may not wish to always enter the merge code (discussed above) but would rather manipulate it as if it was an answer to a question in the survey, thus making it available throughout the Simple Piping Wizard drop-downs. To do this, you can store the query string value within a Hidden Value action.

- On the first page of the survey, select Add Action from the top right of the page
- Select the Hidden Value action and click Add Actions at the bottom of the page

- Set the following example values based upon the query string: ?userid=123
- Hidden Field Name: userid (The name of the variable)
- Value: [%%GET_userid] (The merge code for the variable)
- Click Save Changes at the bottom
Repeat the above steps for every variable in the query string. Once completed, you now have access to those values throughout SurveyGizmo anywhere that we provide a drop-down of questions within the survey. This includes show-when rules, browser redirects, and the simple piping wizard. It allows you to use the simple built-in tools as much as possible rather than consistently using the merge code (used in Value above).
Furthermore, now that the information is stored in a Hidden Value action, it will be accessible as part of the reporting feature and allow you to create Summary Reports that can compile and graph these values. More on this particular usage will be part of the examples in part 3 of this series.
In the following sections, we will cover the ways to transfer this information back out of the survey when redirecting individuals to another webpage.
Sending Values through the Browser Redirect Action
The Browser Redirect action can be placed on any page after the first page of the survey and will immediately cause the respondent, when arriving on the page, to be redirected to the URL provided. The Hidden Value action above becomes very valuable in this scenario, as it makes the built-in user interface options simple to use within the Browser Redirect action.

The first field of interest is the URL field. Place the URL or address of the target website the respondent will be redirected to, excluding any query string information. The query string is built automatically using the ‘Fields to Pass’ section at the bottom of the Redirect Browser action page.
If your account level allowed you to set Hidden Value actions with the query string values, as instructed previously, the next step is to select the Hidden Value actions from the drop-down on the left, therefore its value will be sent as the variable’s value in the query string. The second column, “Variable Name”, refers to the variable name you wish to associate with the value selected from the drop-down.
In the example pictured above, I’ve used the ‘userid’ query string value that was stored in a Hidden Value action, and I want to send the redirect along using the same name. Therefore, the ‘Variable Name’ for the first row should be set to the same as the original variable name, in this case ‘userid’.
The “Default Value” column serves two purposes in this scenario:
- If there is no value set for the question selected in the drop-down to the left, in this case that would occur if the survey was taken without a query string variable named ‘userid’ present or no query string at all, you can set a default value to be transmitted, such as ‘na’.
- If you do not have access to the Hidden Value action, you can place the merge code as the default value. Using the example, the merge code would be: [%%GET_userid]
Finally, you can also send along extra query string variables and values that are unrelated to the information that was passed into the survey. This can be used, for example, to add an extra variable to identify a disqualified respondent. To do so, do not select a question from the drop-down, place the variable name in the “Variable Name” column, and set its value in the “Default Value” column. SurveyGizmo will automatically take this information and convert it to be compatible for the query string.
Sending Values through the Advanced Page Logic Redirect
When using the Advanced Page Jumping & Logic action, you have the ability to apply rules to multiple questions and determine if an individual will be disqualified and/or redirected to a specific webpage. In either case, you may wish to pass along some or all of the query string variables and values to the webpage or create a link on the disqualification page that will include this information. In these situations, we will be using the merge code described at the beginning of this article.
When on the rule editing page, you can set the disqualification message or the URL where you wish to redirect the respondent.
Redirect to external URL

Once you have selected ‘Redirect to external URL’, you will be able to edit the address in the textbox to include the link used to redirect your respondents. Within this link you will be using the merge code and manually building your query string. Let’s break down the example above:
http://www.web.com/?userid=[%%GET_userid]
- Gray base URL link – http://www.mywebsite.com/
- Blue and Red Query String – ?userid=[%%GET_userid]
- This includes the merge code for the query string variable ‘userid’ used in previous examples: [%%GET_userid]
When the redirect occurs, the merge code [%%GET_userid] will be replaced with the value from the query string that was passed to the survey. Therefore, if the survey was passed the query string ?userid=123 the link that the respondent would be redirected to would be:
http://www.web.com/?userid=123
Disqualify Respondent

Once you check the box to ‘Disqualify respondent’, the essay box will appear and allow you to edit the message. In this scenario, if you wish to provide a link back to a particular website and include the variables that were passed to the survey through the query string, it is necessary to use the merge code and add some html. Let’s break down the following portion of the image:
Please <a href=”http://www.mywebsite.com/?userid=[%%GET_userid]“>click here</a> to complete the survey and return to my website.
- Gray base URL link – http://www.mywebsite.com/
- Green HTML code – <a href=”"></a>
- This is the basic structure of a link in HTML. Within the quotations is the URL or address you are sending the link, and between the two sections surrounded by <> is the visible text link.
- Blue and Red Query String – ?userid=[%%GET_userid]
- This includes the merge code for the query string variable ‘userid’ used in previous examples: [%%GET_userid]
This would display the following to the respondent when they were disqualified:
Please click here to complete the survey and return to my website.
In Part 3:Query String Examples of this series, examples and use cases for applying the query string to real world surveys. If you have any questions or problems, please make use of our forums and the SurveyGizmo community!

