Adding object variables to a questionnaire template

Object variables in a questionnaire template are rendered on questionnaire assessments as values from objects associated with the questionnaire assessment that respondent is answering. You can use object variables in a questionnaire template.

You can also add links to questionnaire templates. For information, see Adding links to a questionnaire template.

You can add object variables in the following locations:

  • Section descriptions
  • Subsection descriptions
  • For a question, the Question text and Rationale text in the Additional context section

The variables can insert the following information:

  • The identifier, name, or description of the underlying asset on which the questionnaire assessment is based.
  • The identifier, name, or description of the program from which the questionnaire assessment was launched.
  • The identifier, name, or description of the questionnaire assessment that the respondent is answering.
  • The identifier, name, or description of the questionnaire template from which the questionnaire assessment was created.

For example, the following text in a section description inserts the identifier of the questionnaire assessment, the name of the underlying asset it is related to, and the name of the program that generated it.

This questionnaire assessment, ${questionnaireassessment.id}, is related 
to the following asset: ${asset.name}. 
It is part of the ${program.name} program. 

It is rendered in a questionnaire assessment as:

This questionnaire assessment, 2018-Assessment-7362810, is related to the asset: ResourceA. It is part of the 2018 Annual Risk Assessment Questionnaire program.

Where 2018-Assessment-7362810 is the identifier of the questionnaire assessment, ResourceA is the name of the underlying asset, and 2018 Annual Risk Assessment Questionnaire is the name of the program.

You can create a test program and launch a questionnaire assessment to ensure that the variables are inserted correctly.

Using the content assist feature to choose object variables

You can use the content assist feature to choose from a list of object variables. In the text box, type /? to show all available variables or type ${ followed by the name of the variable to filter the options.

A section description showing the list of available object variables

List of object variables

See the following table for a list of variables. Variables are not case-sensitive.

Table 1. Allowed object variables in questionnaire templates
Object variable Description
${asset.id} Inserts the identifier of the underlying asset
${asset.name} Inserts the asset name of the underlying asset
${asset.description} Inserts the asset description of the underlying asset
${program.id} Inserts the program identifier
${program.name} Inserts the program name
${program.description} Inserts the program description
${questionnaireassessment.id} Inserts the questionnaire assessment identifier
${questionnaireassessment.name} Inserts the questionnaire assessment name
${questionnaireassessment.description} Inserts the questionnaire assessment description
${questionnairetemplate.id} Inserts the questionnaire template identifier
${questionnairetemplate.name} Inserts the questionnaire template name
${questionnairetemplate.description} Inserts the questionnaire template description