ChoiceList defines the dropdown choices presented in a pre-chat field. It controls the available option values, their display positions, their default-selection settings, and any custom-label mappings attached to those options.
A ChoiceList is the deployable metadata component. Its choiceListValue entries are contained ChoiceListValue definitions, not independently deployable assets. The inherited fullName identifies the component; masterLabel supplies its required label.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
Identifies the metadata component. Inherited from Metadata; distinct from its label. |
masterLabel |
Required label for the choice list. |
description |
Describes the choice list and can document its intent. |
choiceListValue |
Contains the list of choices displayed in the dropdown. |
choiceListValue.valueName |
Required string defining the option value. This is not a custom-label reference. |
choiceListValue.isDefaultValue |
Required boolean, true or false, indicating whether the option should be selected by default. |
choiceListValue.order |
Required integer determining the option's display position in the dropdown, not an execution sequence. |
choiceListValue.embeddedServiceCustomLabels |
Contains custom-label mappings for the option. |
customLabel |
Within an option's custom-label mapping, references a CustomLabel component. |
feature |
Within a custom-label mapping, identifies the embedded-component feature. The pre-chat example uses EmbeddedMessaging. |
labelKey |
Within a custom-label mapping, identifies the label's role. The pre-chat option-label example uses EM_PreChat_ChoiceList_PrechatCustomFieldLabel. |
Behavior and Constraints
Each option requires valueName, isDefaultValue, and order. Default selection and display order are separate settings: placing an option first does not itself select it by default. Set isDefaultValue explicitly for each option.
An option can contain custom-label mappings under embeddedServiceCustomLabels. In each mapping, customLabel identifies the label component, while feature and labelKey identify the embedded-component context and label role. For example, a pre-chat option label can pair feature value EmbeddedMessaging with labelKey value EM_PreChat_ChoiceList_PrechatCustomFieldLabel. These are example settings, not defaults.
Keep valueName separate from customLabel: the first defines the option value, and the second references a label component. There are no additional access requirements specific to ChoiceList.
Deployment and Retrieval
ChoiceList components use the .ChoiceList file suffix and are stored in the ChoiceList folder. Deploy or retrieve the containing component rather than treating its ChoiceListValue entries as separate metadata assets.
The package.xml manifest, which selects components for deployment or retrieval, supports the wildcard * for this type. To select all choice lists, use ChoiceList as the type's name and * as its members value. See Deploying and Retrieving Metadata with the Zip File for manifest usage.
Custom labels referenced under choiceListValue.embeddedServiceCustomLabels.customLabel are dependencies beyond the choice list itself. Account for the labels actually referenced when assembling a deployment or assessing the impact of a label change; inspecting only valueName does not identify those dependencies.
Relationships
ChoiceList contains its option definitions and their embedded custom-label mappings. The external component references that matter here are the custom labels attached to those options.
References
-
CustomLabel:customLabel, nested underchoiceListValue.embeddedServiceCustomLabels.
Common Questions
How do I retrieve all ChoiceList components?
Use ChoiceList as the type name and * as the member in package.xml. The component files use the .ChoiceList suffix in the ChoiceList folder.
Can I deploy a ChoiceListValue separately?
No. A ChoiceListValue is a contained definition within ChoiceList, not an independently deployable asset. Deploy the containing choice list.
Does putting an option first make it the default?
No. order controls display position. isDefaultValue separately indicates whether the option should be selected by default.
Why does my ChoiceList have a CustomLabel dependency?
An option can reference a CustomLabel through choiceListValue.embeddedServiceCustomLabels.customLabel. That reference identifies the label component; it is separate from the option's valueName.