Managing Survey Layout from survey link

Do you need to set layout (images, background colour etc) depending on from where the respondents enter your survey?

This tip explains how you can set the Survey Layout depending on how you access the survey. Maybe you have a pop-up survey going out to different departments/divisions of your company? And for each department you have different layout (logos etc)? Well, here's a way to solve that problem.

This can be done by adding an extra variable/parameter to the survey URL. The different links to the survey can then look like this:

First thing that we have to do is to capture the theme variable that has been added to the survey link. This is done using the Request function. (You can read more about this function in Confirmit Scripting Manual, chapter 16.1. Request.)

And then we assign this captured value to an open text hidden question node (here named openQ) that will hold the value for us.

At the very beginning of the survey, insert a script node with the following script code:

/* Capture the value of the theme parameter */

/* Function that returns theme name as a String */
function ThemeName(theme : String) : String{
  if(theme == "1")
    return "Orange Theme";
  if(theme == "2")
    return "Green Theme";

After the script node, insert an open text question with question ID openQ. Set openQ to be hidden (properties->Variable type).

Then you can just call the method from the script node with the value from openQ. That is done in the Theme field for i.e. the Page Object, like this:



If an empty or a non-valid theme value is added to the survey URL, the default theme will be used. This means that you do not have to include any checks for the theme value in your survey.

Here are two links that explain the functionallity: