In this article
The Question ID (qid) is the identification code used by Survey Designer for the question. This code is generated automatically when the question is created, and comprises an alphanumeric string with no spaces. The qid in its default format starts with a letter depending on the question type, and all the qids in a survey are numbered consecutively, starting from 1, in the order in which they were created. If a question is deleted, it’s qid is not reused. You may replace the system-generated qid with your own (see below), but the qid MUST be unique for the survey.
A number of points should be noted:
- The maximum length for a qid is 50 characters.
- Use invalidResp as the qid to exclude certain records from reporting, for example if you suspect the survey respondent has just provided random answers (go to Appendix C - Reserved Keywords for more information). See also the separate SmartHub User Guide.
The qid is displayed for each question, both in the Survey pane and on the toolbar of the question’s question details page.
Figure 1 - The qid for a question is displayed in the Survey pane and in its details page
You can edit the qid. To do this click on the qid Edit icon (the “pencil” icon arrowed in the figure above) to open the field, and edit the qid as required. The qid displayed in the Survey pane is updated automatically. Note that the qid MUST be unique for the survey.
Note: You do not have to change the default qid for a node, even if you introduce a node between other existing nodes (for example at a late stage of the survey construction). However if you do change the qid, be very careful to ensure the new qid is unique for the survey! For example, if you introduce a new question between questions q5 and q6, where q5 is a multi question, do not label the new question q5_2 as this will already be the code for the second alternative in the original question q5.
If you change a qid when the survey is live, a new column will be created in the database. The old column will however remain in the database with its original qid and any data that was gathered up to the point the qid was changed. If a survey has previously been launched to production then you should not later reuse an “old” qid for a different question type, or change the case of any characters in an existing qid. Doing this can cause problems when exporting the data because the question that used the qid originally will still exist in the database. If you intend to relaunch the survey using the Create New Database option then this is not an issue because the database is created anew.
Warning!
If you change a qid when the survey is live then any data already gathered by that question may be lost. In this event the data will not be retrievable, even if the qid change is reverted.