AssessmentQuestion

Represents the container object that stores the questions required for an assessment.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

AssessmentQuestion components have the suffix .AssessmentQuestion and are stored in the AssessmentQuestions folder.

Version 

Introduced in API version 55.0.

Fields 

assessmentQuestionVersion 

  • Type: AssessmentQuestionVersion
  • Required: No
  • Description: The object that stores the question versions for the assessment questions.

dataType 

  • Type: string
  • Required: Yes
  • Description: Required.

developerName 

  • Type: string
  • Required: Yes
  • Description: Required.

disclosureDefinitionVer 

  • Type: string
  • Required: No

displayTextCategory 

  • Type: string
  • Required: No
  • Description: Specifies the category of the display text when the data type is Text Block.

formulaResponseDataType 

  • Type: string
  • Required: No
  • Description: Specifies the data type of the question response calculated by a formula.

name 

  • Type: string
  • Required: Yes
  • Description: Required.

questionCategory 

  • Type: string
  • Required: Yes
  • Description: Required.

relatedQuestion 

  • Type: string
  • Required: No
  • Description: Specifies the related question. Used to define a question hierarchy.

AssessmentQuestionVersion Type 

Stores the question versions for the assessment questions.

Fields 

additionalInformation 

  • Type: string
  • Required: No
  • Description: The additional details for a UI element, such as the disclosure text.

assessmentQuestionVersionChoices 

description 

  • Type: string
  • Required: No
  • Description: The description for the assessment question. This text isn’t rendered on the assessment.

guidanceInformation 

  • Type: string
  • Required: No
  • Description: The guidance for the assessment question.

helpText 

  • Type: string
  • Required: No
  • Description: The text that’s added as an info bubble in the UI element related to the assessment question.

isActive 

  • Type: boolean
  • Required: Yes
  • Description: Required.

name 

  • Type: string
  • Required: Yes
  • Description: Required.

optionSourceResponseValue 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the response value source for an assessment question is configured as custom (true) or sObject in the OmniStudio designer (false).

questionText 

  • Type: string
  • Required: Yes
  • Description: Required.

responseValues 

  • Type: string
  • Required: No
  • Description: Holds the values to be defined in the picklist, multiselect picklist, or radio buttons.

status 

  • Type: string
  • Required: Yes
  • Description: Required.

versionNumber 

  • Type: int
  • Required: Yes
  • Description: Required.

AssessmentQuestionVersionChoice Type 

Fields 

choiceDescription 

  • Type: string
  • Required: Yes

choiceScore 

  • Type: double
  • Required: Yes

displayOrder 

  • Type: int
  • Required: No

icon 

  • Type: string
  • Required: No

key 

  • Type: string
  • Required: Yes

name 

  • Type: string
  • Required: Yes

Declarative Metadata Sample Definition 

The following is an example of an AssessmentQuestion component.

1<?xml version="1.0" encoding="UTF-8"?>
2<AssessmentQuestion
3	xmlns="http://soap.sforce.com/2006/04/metadata">
4	<assessmentQuestionVersion>
5		<additionalInformation>ParentQuestionDevName AI</additionalInformation>
6		<description>ParentQuestionDevName Desc</description>
7		<helpText>ParentQuestionDevName HT</helpText>
8		<isActive>true</isActive>
9		<name>ParentQuestionDevName</name>
10		<optionSourceResponseValue>true</optionSourceResponseValue>
11		<questionText>ParentQuestionDevName Text</questionText>
12		<status>Active</status>
13		<versionNumber>1</versionNumber>
14	</assessmentQuestionVersion>
15	<dataType>DateTime</dataType>
16	<developerName>ParentQuestionDevName</developerName>
17	<name>ParentQuestionDevName</name>
18	<questionCategory>Demographic</questionCategory>
19</AssessmentQuestion>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package
3	xmlns="http://soap.sforce.com/2006/04/metadata">
4	<types>
5		<members>*</members>
6		<name>AssessmentQuestion</name>
7	</types>
8	<version>55.0</version>
9</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.

Usage 

Before you retrieve assessment questions, we recommend that you review these considerations.

  • When you retrieve an assessment question, you also get the related assessment question version with the status Active..

Note: If an active assessment question version doesn’t exist for the assessment question, then the latest assessment question version with Status as Draft is retrieved.

  • The value for the <status> tag in the XML definition must match the status of the related assessment question version.
  • If an assessment question has a related assessment question (parent question), the XML definition must include the developer name of the related assessment question.
  • If the fields of an assessment question contain values, the XML definition must contain tags with those values when retrieving it.

Before you deploy assessment questions, we recommend that you review these considerations.

  • If the Related Question isn’t available in the target org, deploying the assessment question fails.
  • If an assessment question with the same developer name exists in the target org, deploying the assessment question updates the values of the other fields in the target org.
  • If the <versionNumber> tag is present in the XML definition of an assessment question, deploying creates a version for that question in the target org.
  • If the Related Questions aren’t available in target org but available in the package, then deploying the questions inserts the Related Questions in the correct order.
  • If the assessment questions are associated with flows of type Discovery Framework Data Capture Flow, then deploy the assessment questions first. After deploying the assessment questions, deploy the flows.