Masking code boxes
Code boxes, along with code labels (i.e. response options) can be hidden for multiple and single response type questions. These response options can be hidden in a matter of two ways, statically and dynamically.
Static masking is used to hide a response option in all conditions of the survey. Meaning, once applied to a question the response option will always be hidden. This might be useful for grid questions where one option is not applicable for a specific row within the grid. When used, the response option that is desired to be hidden is referenced and prefaced with the word “not” (i.e. “not 5”).
Dynamic masking is used to conditionally show response options based on a response to a previous question. This type of masking can be used to customize a survey’s response options based on how a respondent is answering questions.
Below are two examples of dynamic masking. Static masking will not be covered directly in this work sheet.
Example One: Masking follow-up questions with the response options
- First, there will need to be two questions with identical response options. The best way to do this is by cloning the first question to make the second. To clone a question, select it in the Questionnaire Design window .
- Click Clone to clone the selected question which will appear just below the selected question. The text of the cloned question should be edited appropriately and the response type can be changed to single:
- The masking feature should be applied to the cloned question; in this example that’s Q2. To apply masking, right click the question and select Variable Properties. This opens the Variable Properties window where you can set the Mask property.
- To Mask the cloned question so that only the options selected in a previous question are shown, the following syntax should be applied: “Question Name” (i.e. Q1)
- If the opposite masking is desired (show response options that were not selected), the syntax should be as follows: “not Question Name” (i.e. not Q1)
- Once the masking is applied, click Save to save the questionnaire.
- To preview the masking feature, publish the survey in preview mode .
Example Two: Conditionally masking using derived variables.
In this example respondents will first pick the location where they work. Then, based on the location they picked, the response options of a latter question will only show the options available at that location. This would be useful in situations where response options for a question need to be grouped together and filtered out based on previous responses.
- Create a question that will represent each group of masked options. In this example there will be three office locations:
- Now create the question that will contain masking. This question should contain all of the possible response options. For example:
- Next, the derived variable that determines the logic of the applied masking should be created. Click Variables and select the question being masked from the variables list, Q2.
- Click Clone to create a new variable based on the selected question, Q2.
- Edit the new variable so that the Type is set to Derived and Response is set to Multiple.
- Set the code values for each response option in the derived variable. Each code value response references the masking question, for example Q1=(1,2,3)
- The following shows the values for the departments at each office location:
- London has Customer Services and Training
- New York has Accounting, Customer Services, Human Resources, IT Support, Research, Sales and Training
- Paris has Accounting, Customer Services, Data Center, Development, Human Resources, IT Support, Research, Sales and Training.
- Click Save to save the derived variable.
- In the Questionnaire window, select the masked question, right click and select Variable Properties .
- In the Mask property enter the name of the derived variable, V1, as the masking value:
- Click OK to save the masking value.
- Once the masking is applied, click Save to save the survey.
- To preview the masking feature in action, publish the survey in preview mode .
Alternative masking derived variable definition
There is an alternative way to define the derived variable used for masking. When the Toggle Definition is selected the definition fields are shown, including the Initial Value field. The Initial Value field can be used to enter a calculation that provides the basis for the values in the code list. This simplifies the code values when using a long calculation. The diagram shows the equivalent derived variables; one with an initial value and one without. Both these derived variables will behave in the same way.
If there is a topic you would like a tutorial on, email to snapideas@snapsurveys.com