Newer Version Available

This content describes an older version of this product. View Latest

CleanDataService

Represents a data service that adds and updates data in standard objects. This type extends the Metadata 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 43.0 and later.

Fields

Field Name Field Type Description
cleanRules CleanRule[] Required. A list of data integration rules
description string Required. A description of the data service
masterLabel string Required. Master 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.

Field Name Field Type Description
bulkEnabled boolean 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 boolean 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 boolean 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 string Required. User-friendly text that describes the data integration rule.
developerName string 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.
fieldMappings FieldMapping[] Required. A list of FieldMapping entries for the rule.
masterLabel string Required. Master label for this object. This display value is the internal label that is not translated.
matchRule string Required. An internal label for a matching rule in the data service that’s associated with the CleanRule.
sourceSobjectType string Required. A virtual object in the data service that is associated with the CleanRule. Specifying a non-existent object causes an error.
status string Required. Status of the data integration rule. Valid values are Active and Inactive.
targetSobjectType string 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

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

Field Name Field Type Description
developerName string 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.
fieldMappingRows FieldMappingRow[] 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 string Required. Master label for this object. This display value is the internal label that is not translated.
SObjectType string Required. The standard object associated with this FieldMapping. Specifying an object that the data service does not support causes an error.

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[] 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.

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.