---
schema_version: "1"
id: 8704d24c2117b6f1e16ff574750ba62ec98a18f61bcacc76cd9b6d928d7eb32a
title: ServiceAISetupField
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_serviceAIsetupfield.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_serviceAIsetupfield.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7a0f3e303bed2ddb79fb7b76bc169d7b0d935a1714bbd797688ee1a9d74ad41e
description: Represents a field on cases or knowledge articles that Einstein uses to identify relevant articles in Einstein Article Recommendations. This type extends the Metadata metadata type and inherits its fullName field.
---
# ServiceAISetupField

Represents a field on cases or knowledge articles that Einstein uses to identify relevant articles in Einstein Article Recommendations. This type extends the Metadata metadata type and inherits its fullName field.

## File Suffix and Directory Location

ServiceAISetupField components have the suffix .serviceAiSetupField and are stored in the serviceAiSetupFields folder.

## Version

ServiceAISetupField components are available in API version 51.0 and later.

## Special Access Rules

This type is available only if Einstein Article Recommendations is enabled in your org and the Main Services Agreement has been accepted.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d852625e93">Field Name</th>

              <th class="featureTableHeader  " id="d852625e96">Field Type</th>

              <th class="featureTableHeader  " id="d852625e99">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">entity</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">string</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. The Case or KnowledgeArticle object for the field. </td>

            </tr>

            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">field</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">string</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. The API name of the field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">fieldMappingType</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">ServiceAISetupFieldType (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type
                string)</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. The field type. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">CASE_DESC</samp></li>

                  <li class="li"><samp class="codeph nolang">CASE_SUBJ</samp></li>

                  <li class="li"><samp class="codeph nolang">ARTICLE_TITLE</samp></li>

                  <li class="li"><samp class="codeph nolang">ARTICLE_CONTENT</samp></li>

                  <li class="li"><samp class="codeph nolang">ARTICLE_SUMMARY</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">fieldPosition</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">int</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. A positive number used to rank the field’s importance. The value 1 is
                most important; higher numbers indicate less important fields. Einstein considers
                fields in the order of importance.</td>

            </tr>

            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">string</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. A reference to the field.</td>

            </tr>

            <tr>
              <td class="entry" headers="d852625e93" data-title="Field Name"><span class="keyword parmname">setupDefinition</span></td>

              <td class="entry" headers="d852625e96" data-title="Field Type">string</td>

              <td class="entry" headers="d852625e99" data-title="Description">Required. A reference to the parent <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_serviceAIsetupdefinition.htm" title="Represents settings for an Einstein for Service feature such as Einstein Article Recommendations. This type extends the Metadata metadata type and inherits its fullName field.">ServiceAISetupDefinition.</a>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is an example of a ServiceAISetupField component.

<?xml version="1.0" encoding="UTF-8"?>
<ServiceAISetupField xmlns="http://soap.sforce.com/2006/04/metadata">
    <entity\>Case</entity\>
    <field\>Subject</field\>
    <fieldMappingType\>CASE\_SUBJ</fieldMappingType\>
    <fieldPosition\>1</fieldPosition\>
    <name\>SF16039900475920</name\>
    <setupDefinition\>4hQRM0000004CDK</setupDefinition\>
</ServiceAISetupField\>

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

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>\*</members\>
        <name\>ServiceAISetupField</name\>
    </types\>
</Package\>

## Usage

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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").