Personalizing questionnaires

A questionnaire can include information that is unique to the respondent using the techniques described here. The information can be used in a myriad ways, such as to provide a personal greeting, to provide different choices, to control the path taken through a questionnaire. These techniques are illustrated in the Examples.

Using query string parameters

Every questionnaire has a unique URL, displayed in the Publish page. I has the form:
http://yourcompany.com/ViewsFlash/servlet/viewsflash?cmd=page&pollid=pollingplace!questionnaire

By adding extra parameters to the URL, the values of questions can be filled in. For example, if a questionnaire includes questions "name" and "title", the following URL will pre-populate them:
http://yourcompany.com/ViewsFlash/servlet/viewsflash?cmd=page&pollid=pollingplace!questionnaire&name=Tom+Jones&title=Mr.

Then using the question piping technique, these vales can be displayed, usually in a question of type HTML:
Dear [/title] [/name] becomes Dear Mr. Tom Jones
Note that the + in the URL is replaced with a space by the browser when the URL is included in an email or web page.

This feature is used by Invite Lists, which can send personalized emails that include, for example,the participant's name in the URL.
This technique can also be used with any external systems that can create a dynamic URL.

Using database queries

Every questionnaire uses an Authentication method. The method chosen results in the questionnaire having a unique id, except when duplicate ids are explicitly allowed. Using question piping, it is possible to refer to the questionnaire's unique id as [/authenticateduserid]. This value can be used with the SQLSelect action to populate questions from a database query that uses the unique id as the lookup key in a SQL statement's WHERE clause. The values that are retrieved can be used in visible questions or in questions of type hidden. All those values are available throughout ViewsFlash as if they had been entered by the respondent.

Using session attributes

Using the Script action, it is possible to retrive HTTP session attributes and store them in questions. This is useful when ViewsFlash works in conjunction with a suite of applications, and those applications leave values in the session for a questionnaire to use. These values can even include the unique questionnaire ID used for authentication.

Next: Data Validation