ServiceAISetupField configures how an existing field on Case or KnowledgeArticle participates in Einstein Article Recommendations. It identifies the field, assigns its recommendation-input role, and ranks its importance when Einstein identifies relevant articles.
This type does not define the underlying field. Each component belongs to a parent ServiceAISetupDefinition, referenced through setupDefinition. Its field references are also distinct from the inherited fullName that identifies the metadata component itself.
Key Elements
| Element | What the Element Controls |
|---|---|
entity |
Required. Identifies the object containing the field: Case or KnowledgeArticle. |
field |
Required. Supplies the field's API name, such as Subject. |
fieldMappingType |
Required. Assigns the recommendation-input role. The documented values are CASE_DESC, CASE_SUBJ, ARTICLE_TITLE, ARTICLE_CONTENT, and ARTICLE_SUMMARY. |
fieldPosition |
Required. A positive integer ranking the field's importance. 1 is most important; higher numbers mean lower importance. Einstein considers fields in this importance order. |
name |
Required. A reference to the field. It is distinct from both field, which explicitly supplies the field's API name, and the component's inherited fullName. |
setupDefinition |
Required. References the parent ServiceAISetupDefinition. |
fullName |
Inherited from the base Metadata type. Identifies the ServiceAISetupField metadata component, not the underlying field. |
Behavior and Constraints
ServiceAISetupField is available only when Einstein Article Recommendations is enabled in the org and the Main Services Agreement has been accepted. These are access prerequisites for the metadata type.
entity and field identify the existing recommendation input. fieldMappingType describes its role, while fieldPosition controls its relative importance. The position is an operational priority setting, not merely a display order: Einstein considers more important fields first.
Do not treat name, field, and fullName as interchangeable identifiers. Although name is documented as a field reference, only field is explicitly defined as the field's API name.
Deployment and Retrieval
Components use the .serviceAiSetupField suffix and are stored in the serviceAiSetupFields directory.
The type supports the wildcard * in a package.xml manifest, the file that selects metadata components for deployment or retrieval. To select the type's components with a wildcard, use ServiceAISetupField as the manifest type name and * as its member.
The referenced object, field, and parent configuration are separate dependencies. References in a ServiceAISetupField component do not imply that deploying it also creates those dependencies. The type's feature-enablement and agreement prerequisites still apply when working with its metadata.
Relationships
The dependency links connect the recommendation input to its object, its field, and its parent configuration. Both field and name are recognized field-reference elements, despite their different documented meanings.
References
-
CustomObject:entity. -
CustomField:field,name. -
ServiceAISetupDefinition:setupDefinition.
Documentation Inconsistencies
The exposed element schema lists ARTICLE_ANSWER and ARTICLE_QUESTION as additional fieldMappingType values. The official platform documentation lists only CASE_DESC, CASE_SUBJ, ARTICLE_TITLE, ARTICLE_CONTENT, and ARTICLE_SUMMARY. The two additional values are therefore exposed in the schema but not described in the platform value list; this difference does not by itself establish their supported use.
Common Questions
Does ServiceAISetupField create a Case or Knowledge field?
No. It configures how an existing field participates in Einstein Article Recommendations. It does not define the underlying field.
Does fieldPosition affect Einstein Article Recommendations?
Yes. Einstein considers fields in importance order. fieldPosition must be a positive integer, with 1 representing the highest importance.
Can I retrieve ServiceAISetupField with a wildcard?
Yes. The type supports * as a member under ServiceAISetupField in package.xml. The org must have Einstein Article Recommendations enabled and the Main Services Agreement accepted.
Are name, field, and fullName the same identifier?
No. field explicitly holds the field's API name, name is documented as a field reference, and inherited fullName identifies the ServiceAISetupField metadata component.