---
schema_version: "1"
id: 964db079a2062b81911ca7d62504336003d4d9297a642877b8b0c00073fccd59
title: CleanDataService
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_cleandataservice.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cleandataservice.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 894ad0b0a631eab5307d0e84f7abb8e3b4ca14166c302bbc0a9b2a0792f4aa82
description: Represents a data service that adds and updates data in standard objects.
---
# CleanDataService

Represents a data service that adds and updates data in standard objects.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

## File Suffix and Directory Location

CleanDataService components have the .cleanDataService suffix and are stored in the cleanDataServices directory. The name of the component file is based on the name of the object associated with the data service. For example, the component file name cleanDataServices/DataCloudCompanyMatch.cleanDataService describes a data service component called DataCloudCompanyMatch that's associated with the company name in account objects.

## Version

CleanDataService components are available in API version 68.0 and later.

## Fields

| Field Name | Field Type | Description |
| --- | --- | --- |
| cleanRules | [CleanRule](#CleanRule)\[\] | Required. A list of data integration rules |
| description | string | Required. A description of the data service |
| masterLabel | string | Required. Label for this data service. Although this value is displayed, it’s an internal label for the data service and isn’t translated. |
| matchEngine | string | Required. A key that maps to the internal data service identifier. |

## CleanRule

Represents information that controls how the data service adds and updates data in an org.

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



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

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

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

            </tr>

          </thead>

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

              <td class="entry" headers="d245701e206" data-title="Field Type">boolean</td>

              <td class="entry" headers="d245701e209" data-title="Description">Required. If this field is set to <samp class="codeph nolang">true</samp>,
                Salesforce applies the data integration rule to existing records whenever the rule
                is updated or saved. </td>

            </tr>

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

              <td class="entry" headers="d245701e206" data-title="Field Type">boolean</td>

              <td class="entry" headers="d245701e209" data-title="Description">Required. If this field is set to <samp class="codeph nolang">true</samp>,
                Salesforce bypasses triggers when it applies the rule; otherwise, it applies
                triggers after it applies the rule.</td>

            </tr>

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

              <td class="entry" headers="d245701e206" data-title="Field Type">boolean</td>

              <td class="entry" headers="d245701e209" data-title="Description">Required. If this field is set to <samp class="codeph nolang">true</samp>,
                Salesforce bypasses workflow rules when it applies the data integration rule;
                otherwise, it applies workflow rules after it applies the rule.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. User-friendly text that describes the data integration rule.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. This name can contain only underscores and alphanumeric characters,
                and must be unique in your org. It must begin with a letter, not include spaces, not
                end with an underscore, and not contain two consecutive underscores. This unique
                name prevents conflicts with rules from other packages that have the same
                <span class="keyword parmname">masterLabel</span>.<div class="box message info">
                  <div class="inner">
                    <div class="bd">
                      <div class="media">
                        <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png" alt="Note">
                        <div class="mediaBd">
                          <h4 class="mbs">Note</h4>
                          <p>Only users with View DeveloperName OR View
                            Setup and Configuration permission can view, group, sort, and filter this
                            field.</p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </td>

            </tr>

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

              <td class="entry" headers="d245701e206" data-title="Field Type">
                <a class="xref" href="#FieldMapping">FieldMapping</a>[]
              </td>

              <td class="entry" headers="d245701e209" data-title="Description">Required. A list of FieldMapping entries for the rule.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. Label for this object. This display value is the internal label that
                is not translated.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. An internal label for a matching rule in the data service that’s
                associated with the CleanRule.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. A virtual object in the data service that is associated with the
                CleanRule. Specifying a non-existent object causes an error.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. Status of the data integration rule. Valid values are <samp class="codeph nolang">Active</samp> and <samp class="codeph nolang">Inactive</samp>.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e209" data-title="Description">Required. A standard object that’s the target of additions and updates
                specified by this CleanRule. Specifying an object that the data service does not
                support causes an error.</td>

            </tr>

          </tbody>

        </table>

## FieldMapping

Represents a mapping between fields in the data service and fields in an object in the org.

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



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

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

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

            </tr>

          </thead>

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

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

              <td class="entry" headers="d245701e416" data-title="Description">Required. This name can contain only underscores and alphanumeric characters,
                and must be unique in your org. It must begin with a letter, not include spaces, not
                end with an underscore, and not contain two consecutive underscores. This unique
                name prevents conflicts with field mappings from other packages that have the same
                <span class="keyword parmname">masterLabel</span>.<div class="box message info">
                  <div class="inner">
                    <div class="bd">
                      <div class="media">
                        <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png" alt="Note">
                        <div class="mediaBd">
                          <h4 class="mbs">Note</h4>
                          <p>Only users with View DeveloperName OR View
                            Setup and Configuration permission can view, group, sort, and filter this
                            field.</p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </td>

            </tr>

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

              <td class="entry" headers="d245701e413" data-title="Field Type">
                <a class="xref" href="#FieldMappingRow">FieldMappingRow</a>[]
              </td>

              <td class="entry" headers="d245701e416" data-title="Description">Required. A list of FieldMappingRow entries. Each entry represents a field in a
                standard object that maps to a field in the data service.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e416" data-title="Description">Required. Label for this object. This display value is the internal label that
                is not translated.</td>

            </tr>

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

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

              <td class="entry" headers="d245701e416" data-title="Description">Required. The standard object associated with this FieldMapping. Specifying an
                object that the data service does not support causes an error.</td>

            </tr>

          </tbody>

        </table>

## FieldMappingRow

Represents the status of a CleanRule.

| Field Name | Field Type | Description |
| --- | --- | --- |
| fieldName | string | The display name for the field represented by the FieldMappingRow. |
| fieldMappingFields | [FieldMappingField](#FieldMappingField)\[\] | Required. A list of FieldMappingField entries. Each entry is a field in a standard object that maps to a field in the data service. |
| mappingOperation | string | The comparison operation the data service applies when it compares the value of this FieldMappingRow to the mapped field in the object specified in SObjectType. The value of this field is AutoFill, which indicates that the data service only adds data if the object field is blank. |
| SObjectType | string | The standard object for the field mapped to the FieldMappingRow. Specifying an object that the data service does not support causes an error. |

## FieldMappingField

Represents a field in a standard object. A FieldMappingField maps to a FieldMappingRow entry in a data service.

| Field Name | Field Type | Description |
| --- | --- | --- |
| dataServiceField | string | Required. A field in the data service that is mapped to this field. |
| dataServiceObjectName | string | Required. An object in the data service that contains the FieldMappingRow associated with this FieldMappingField. Specifying a non-existent object causes an error. |
| priority | int | Required. Represents the priority that the data service uses when it updates the field, relative to other update rules for the same field. Valid values are 1-100. |

## Declarative Metadata Sample Definition

The following is an example of a CleanDataService component for the lead standard object.

<?xml version="1.0" encoding="UTF-8"?>
<CleanDataService xmlns="http://soap.sforce.com/2006/04/metadata">
    <cleanRules\>
        <bulkEnabled\>false</bulkEnabled\>
        <bypassTriggers\>false</bypassTriggers\>
        <bypassWorkflow\>false</bypassWorkflow\>
        <description\>Adds data info to leads</description\>
        <developerName\>DataService\_Leads\_Enrichment</developerName\>
        <fieldMappings\>
            <SObjectType\>DataServiceCompanyObject</SObjectType\>
            <developerName\>DataService\_Leads\_Enrichment\_InputMapping</developerName\>
            <fieldMappingRows\>
                <SObjectType\>DataServiceCompanyObject</SObjectType\>
                <fieldMappingFields\>
                    <dataServiceField\>Email</dataServiceField\>
                    <dataServiceObjectName\>Lead</dataServiceObjectName\>
                    <priority\>1</priority\>
                </fieldMappingFields\>
                <fieldName\>Email</fieldName\>
                <mappingOperation\>Autofill</mappingOperation\>
            </fieldMappingRows\>
            <fieldMappingRows\>
                <SObjectType\>DataServiceCompanyObject</SObjectType\>
                <fieldMappingFields\>
                    <dataServiceField\>Company</dataServiceField\>
                    <dataServiceObjectName\>Lead</dataServiceObjectName\>
                    <priority\>1</priority\>
                </fieldMappingFields\>
                <fieldName\>Name</fieldName\>
                <mappingOperation\>Autofill</mappingOperation\>
            </fieldMappingRows\>
            <masterLabel\>DataServiceInputMapping</masterLabel\>
        </fieldMappings\>
        <fieldMappings\>
            <SObjectType\>Lead</SObjectType\>
            <developerName\>DataService\_Leads\_Enrichment\_OutputMapping</developerName\>
            <fieldMappingRows\>
                <SObjectType\>Lead</SObjectType\>
                <fieldMappingFields\>
                    <dataServiceField\>EmployeesTotal</dataServiceField\>
                    <dataServiceObjectName\>DataServiceCompanyObject</dataServiceObjectName\>
                    <priority\>1</priority\>
                </fieldMappingFields\>
                <fieldName\>NumberOfEmployees</fieldName\>
                <mappingOperation\>Autofill</mappingOperation\>
            </fieldMappingRows\>
            <fieldMappingRows\>
                <SObjectType\>Lead</SObjectType\>
                <fieldMappingFields\>
                    <dataServiceField\>Revenue</dataServiceField\>
                    <dataServiceObjectName\>DataServiceCompanyObject</dataServiceObjectName\>
                    <priority\>1</priority\>
                </fieldMappingFields\>
                <fieldName\>AnnualRevenue</fieldName\>
                <mappingOperation\>Autofill</mappingOperation\>
            </fieldMappingRows\>
            <fieldMappingRows\>
                <SObjectType\>Lead</SObjectType\>
                <fieldMappingFields\>
                    <dataServiceField\>Industry</dataServiceField\>
                    <dataServiceObjectName\>DataServiceCompanyObject</dataServiceObjectName\>
                    <priority\>1</priority\>
                </fieldMappingFields\>
                <fieldName\>Industry</fieldName\>
                <mappingOperation\>Autofill</mappingOperation\>
            </fieldMappingRows\>
            <masterLabel\>DataServiceOutputMapping</masterLabel\>
        </fieldMappings\>
        <masterLabel\>Data Service Company Info for Leads</masterLabel\>
        <matchRule\>DataServiceLeadAppendMatchRule</matchRule\>
        <sourceSobjectType\>DataServiceCompanyObject</sourceSobjectType\>
        <status\>Active</status\>
        <targetSobjectType\>Lead</targetSobjectType\>
    </cleanRules\>
    <description\>Data Service Companies for Leads</description\>
    <masterLabel\>Data Service Companies for Leads</masterLabel\>
    <matchEngine\>LeadEnrichmentMatchEngine</matchEngine\>
</CleanDataService\>

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\>DataService\_Leads\_Enrichment</members\>
        <name\>CleanDataService</name\>
    </types\>
    <version\>38.0</version\>
</Package\>

## Usage

Use CleanDataService to retrieve all the metadata that describes a data enrichment service. To configure the service in a new org, deploy the metadata you retrieved. Avoid using CRUD-Based Calls with CleanDataService.

To make small modifications to the CleanDataService component, use the Tooling API.

## 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](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).