Online Survey Tutorials
SurveyGizmo Tutorials and Help Documentation
Tutorial: Merge Codes
An example of a merge code is:
[%%12:question%%]
This represents the Reporting Value for a question that is stored by SurveyGizmo from the survey (a.k.a. the respondent’s answer). It can be used as part of piping, email auto-responders, and even when redirecting the browser in the query string. The merge code syntax is also used in other systems within SurveyGizmo, such as email invitations.
To find the merge code within the survey, there are two options: Use the Simple Piping Wizard or find the Question ID and manually create the merge code.
- Use the Simple Piping Wizard
- Go to a question that is after the question you wish to evaluate as part of the rule and click the Advanced Edit icon (the little notebook on the left side of the question). When the question opens up, on the right side of the Question Title box you will see a smaller box that includes the Simple Piping Wizard. Click the link at the bottom of that box that is labeled ‘Select a Variable’. A drop-down box will appear. Select the question from the list and a merge code will appear under the box. Copy that merge code and add it to your rule.
- Create the Merge Code manually
- Go to the specific question which you wish to evaluate in the rule and click the Advanced Edit icon (the little notebook on the left side of the question). When the question opens up, on the right side of the Question Title box you will see a smaller box which includes the Question ID. To create the merge code, use the following format:
[%%xx:%%]
xx represents the question ID found in the question editor, e.g. [%%23:%%]
To clarify, the code is a left square bracket ( [ ), two percentage signs ( %% ), the question ID, a colon ( : ), two percentage signs ( %% ), and a right square bracket ( ] ). - What if there is no Question ID, such as a Quiz Score or Hidden Value action?
- Don’t worry, there is still a Question ID, it is just less obvious to find. To find the Question ID, click the Advanced Edit button for the action or question. Then, look at the browser’s address/URL bar at the top. It would be similar to the following:
http://app.sgizmo.com/surveybuilder/survey_question_editor.php?sid=12345&qid=63&qnum=1
You will see a variable called qid, following by an equals sign and then the Question ID: 63 in the above example. Now you can use the method outlined in option 2 above to create your merge code!
- For a table/matrix, each row has a Question ID assigned to it. To get the question ID, edit the table (notepad icon), and hover your mouse over the textbox for the particular row header, and text will appear below your mouse that will notify you of the Question ID for that row.
- Don’t worry, there is still a Question ID, it is just less obvious to find. To find the Question ID, click the Advanced Edit button for the action or question. Then, look at the browser’s address/URL bar at the top. It would be similar to the following:
- Go to the specific question which you wish to evaluate in the rule and click the Advanced Edit icon (the little notebook on the left side of the question). When the question opens up, on the right side of the Question Title box you will see a smaller box which includes the Question ID. To create the merge code, use the following format:
Multi-Textbox (List of Textboxes) and Continuous Sum Questions
These special questions also have special merge codes which can be used within Question Titles, Hidden Value fields, and Descriptive Text Fields. These special merge codes are not currently compatible within Email Auto-Responders (store them in a Hidden Value field first). This merge codes allow you to pull the contact from one row/textbox within the question. The rows are numbered from top to bottom starting from zero (0) and counting up: 0, 1, 2, 3 would be the first 4 rows of a list of textbox or continuous sum question. The format is similar to the regular merge code, however the following is added after the question id number: an underscore, the capital letter O, and the row number.
Examples:
- [%%12_O0: Do you %%]
- [%%412_O1:%%]
- [%%7_O2:%%]
If you have any further questions, please use our community forums.

