CleanDataService

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

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.

Important

Parent Type 

This type extends Metadata and inherits its fields.

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 

cleanRules 

  • Type: CleanRule[]
  • Required: No
  • Description: Required. A list of data integration rules

description 

  • Type: string
  • Required: Yes
  • Description: Required. A description of the data service

masterLabel 

  • Type: string
  • Required: Yes
  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: Required. A key that maps to the internal data service identifier.

CleanRule Type 

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

Fields 

bulkEnabled 

  • Type: boolean
  • Required: Yes
  • Description: Required. If this field is set to true, Salesforce applies the data integration rule to existing records whenever the rule is updated or saved.

bypassTriggers 

  • Type: boolean
  • Required: Yes
  • Description: Required. If this field is set to true, Salesforce bypasses triggers when it applies the rule; otherwise, it applies triggers after it applies the rule.

bypassWorkflow 

  • Type: boolean
  • Required: Yes
  • Description: Required. If this field is set to true, Salesforce bypasses workflow rules when it applies the data integration rule; otherwise, it applies workflow rules after it applies the rule.

description 

  • Type: string
  • Required: Yes
  • Description: Required. User-friendly text that describes the data integration rule.

developerName 

  • Type: string
  • Required: Yes
  • 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 masterLabel.

Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.

Note

fieldMappings 

  • Type: FieldMapping[]
  • Required: No
  • Description: Required. A list of FieldMapping entries for the rule.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Label for this object. This display value is the internal label that is not translated.

matchRule 

  • Type: string
  • Required: Yes
  • Description: Required. An internal label for a matching rule in the data service that’s associated with the CleanRule.

sourceSobjectType 

  • Type: string
  • Required: Yes
  • Description: Required. A virtual object in the data service that is associated with the CleanRule. Specifying a non-existent object causes an error.

status 

  • Type: CleanRuleStatus (enumeration of type string)
  • Required: Yes
  • Description: Required. Status of the data integration rule. Valid values are Active and Inactive.

targetSobjectType 

  • Type: string
  • Required: Yes
  • 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.

FieldMapping Type 

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

Fields 

developerName 

  • Type: string
  • Required: Yes
  • 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 masterLabel.

Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.

Note

fieldMappingRows 

  • Type: FieldMappingRow[]
  • Required: No
  • 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.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Label for this object. This display value is the internal label that is not translated.

SObjectType 

  • Type: string
  • Required: Yes
  • Description: Required. The standard object associated with this FieldMapping. Specifying an object that the data service does not support causes an error.

FieldMappingField Type 

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

Fields 

dataServiceField 

  • Type: string
  • Required: Yes
  • Description: Required. A field in the data service that is mapped to this field.

dataServiceObjectName 

  • Type: string
  • Required: Yes
  • Description: Required. An object in the data service that contains the FieldMappingRow associated with this FieldMappingField. Specifying a non-existent object causes an error.

priority 

  • Type: int
  • Required: Yes
  • Description: 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.

FieldMappingRow Type 

Represents the status of a CleanRule.

Fields 

fieldMappingFields 

  • Type: FieldMappingField[]
  • Required: No
  • Description: Required. A list of FieldMappingField entries. Each entry is a field in a standard object that maps to a field in the data service.

fieldName 

  • Type: string
  • Required: Yes
  • Description: The display name for the field represented by the FieldMappingRow.

mappingOperation 

  • Type: MappingOperation (enumeration of type string)
  • Required: Yes
  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: The standard object for the field mapped to the FieldMappingRow. Specifying an object that the data service does not support causes an error.

Declarative Metadata Sample Definition 

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

1<?xml version="1.0" encoding="UTF-8"?>
2<CleanDataService xmlns="http://soap.sforce.com/2006/04/metadata">
3    <cleanRules>
4        <bulkEnabled>false</bulkEnabled>
5        <bypassTriggers>false</bypassTriggers>
6        <bypassWorkflow>false</bypassWorkflow>
7        <description>Adds data info to leads</description>
8        <developerName>DataService_Leads_Enrichment</developerName>
9        <fieldMappings>
10            <SObjectType>DataServiceCompanyObject</SObjectType>
11            <developerName>DataService_Leads_Enrichment_InputMapping</developerName>
12            <fieldMappingRows>
13                <SObjectType>DataServiceCompanyObject</SObjectType>
14                <fieldMappingFields>
15                    <dataServiceField>Email</dataServiceField>
16                    <dataServiceObjectName>Lead</dataServiceObjectName>
17                    <priority>1</priority>
18                </fieldMappingFields>
19                <fieldName>Email</fieldName>
20                <mappingOperation>Autofill</mappingOperation>
21            </fieldMappingRows>
22            <fieldMappingRows>
23                <SObjectType>DataServiceCompanyObject</SObjectType>
24                <fieldMappingFields>
25                    <dataServiceField>Company</dataServiceField>
26                    <dataServiceObjectName>Lead</dataServiceObjectName>
27                    <priority>1</priority>
28                </fieldMappingFields>
29                <fieldName>Name</fieldName>
30                <mappingOperation>Autofill</mappingOperation>
31            </fieldMappingRows>
32            <masterLabel>DataServiceInputMapping</masterLabel>
33        </fieldMappings>
34        <fieldMappings>
35            <SObjectType>Lead</SObjectType>
36            <developerName>DataService_Leads_Enrichment_OutputMapping</developerName>
37            <fieldMappingRows>
38                <SObjectType>Lead</SObjectType>
39                <fieldMappingFields>
40                    <dataServiceField>EmployeesTotal</dataServiceField>
41                    <dataServiceObjectName>DataServiceCompanyObject</dataServiceObjectName>
42                    <priority>1</priority>
43                </fieldMappingFields>
44                <fieldName>NumberOfEmployees</fieldName>
45                <mappingOperation>Autofill</mappingOperation>
46            </fieldMappingRows>
47            <fieldMappingRows>
48                <SObjectType>Lead</SObjectType>
49                <fieldMappingFields>
50                    <dataServiceField>Revenue</dataServiceField>
51                    <dataServiceObjectName>DataServiceCompanyObject</dataServiceObjectName>
52                    <priority>1</priority>
53                </fieldMappingFields>
54                <fieldName>AnnualRevenue</fieldName>
55                <mappingOperation>Autofill</mappingOperation>
56            </fieldMappingRows>
57            <fieldMappingRows>
58                <SObjectType>Lead</SObjectType>
59                <fieldMappingFields>
60                    <dataServiceField>Industry</dataServiceField>
61                    <dataServiceObjectName>DataServiceCompanyObject</dataServiceObjectName>
62                    <priority>1</priority>
63                </fieldMappingFields>
64                <fieldName>Industry</fieldName>
65                <mappingOperation>Autofill</mappingOperation>
66            </fieldMappingRows>
67            <masterLabel>DataServiceOutputMapping</masterLabel>
68        </fieldMappings>
69        <masterLabel>Data Service Company Info for Leads</masterLabel>
70        <matchRule>DataServiceLeadAppendMatchRule</matchRule>
71        <sourceSobjectType>DataServiceCompanyObject</sourceSobjectType>
72        <status>Active</status>
73        <targetSobjectType>Lead</targetSobjectType>
74    </cleanRules>
75    <description>Data Service Companies for Leads</description>
76    <masterLabel>Data Service Companies for Leads</masterLabel>
77    <matchEngine>LeadEnrichmentMatchEngine</matchEngine>
78</CleanDataService>

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

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>DataService_Leads_Enrichment</members>
5        <name>CleanDataService</name>
6    </types>
7    <version>38.0</version>
8</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.