CleanDataService defines a data enrichment service that adds and updates data in supported standard Salesforce objects. It is the service-level deployment component: its cleanRules entries control processing, and nested field mappings connect Salesforce fields with fields in the data service.
The service's matchEngine maps to an internal data-service identifier. Each rule's matchRule identifies a matching rule internal to that service; it should not automatically be treated as a reference to duplicate-management MatchingRules metadata. Rules and mappings are nested structures, not replacements for the service component's identity.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The service component's identity, inherited from Metadata. Nested developer names do not replace it. |
cleanRules |
Required list of data integration rules. Activation, bulk processing, automation bypass settings, and field mappings belong to these entries. |
matchEngine, matchRule
|
matchEngine is the required service-level key for the internal data service. matchRule is the required rule-level label for a matching rule within that service. |
developerName |
Required on rules and field mappings. Identifies the nested structure and must be unique in the org. Naming and field-visibility restrictions apply. |
status |
Required rule status. Allowed values are Active and Inactive. |
bulkEnabled |
Required rule-level Boolean. When true, Salesforce applies the rule to existing records whenever the rule is updated or saved. |
bypassTriggers |
Required rule-level Boolean. true bypasses triggers while applying the rule; false applies triggers after the rule. |
bypassWorkflow |
Required rule-level Boolean. true bypasses workflow rules; false applies them after the data integration rule. |
sourceSobjectType, targetSobjectType
|
Required rule-level object names. The source identifies a virtual object in the data service. The target identifies the supported standard Salesforce object receiving additions and updates. |
fieldMappings, fieldMappingRows, fieldMappingFields
|
The nested mapping lists: rules contain mappings, mappings contain rows, and rows contain field entries. Together they describe input and output mappings. |
SObjectType |
Identifies an object at mapping and row levels. Unsupported objects cause errors. The input-mapping example uses this element differently from the field descriptions; see Documentation Inconsistencies. |
fieldName, dataServiceField
|
fieldName identifies the field represented by a row. Required dataServiceField identifies the field paired with it in a nested field entry. Interpret the pair in its mapping context. |
dataServiceObjectName |
Required object name in a field entry. A nonexistent object causes an error. Do not infer mapping direction from this element's name alone. |
mappingOperation |
Controls the row's mapping operation. The exposed enumeration includes Autofill and Overwrite, while the field definition spells the blank-only operation AutoFill. The casing and behavior discrepancy matters when editing metadata. |
priority |
Required integer from 1 through 100. Sets update priority relative to other update rules for the same field. The definition does not say whether lower or higher numbers take precedence. |
Behavior and Constraints
Saving a rule can process existing records
Processing controls belong to each cleanRules entry, not to a service-wide activation setting. Each entry has its own status, bulkEnabled, bypassTriggers, and bypassWorkflow.
When bulkEnabled is true, saving or updating the rule applies it to existing records. A configuration save can therefore initiate data processing rather than merely change future behavior.
The two bypass settings operate independently. With bypassTriggers set to false, Salesforce applies triggers after the rule. With bypassWorkflow set to false, Salesforce applies workflow rules after the data integration rule. Their documented scope is triggers and workflow rules, not all automation or security checks.
Mappings can supply inputs and receive enrichment outputs
The mapping hierarchy is fieldMappings, then fieldMappingRows, then fieldMappingFields. Rows identify fields through SObjectType and fieldName; field entries pair dataServiceObjectName with dataServiceField.
A mapping can supply data to the service or map enrichment data back into Salesforce. For example, a lead-enrichment service can use Email and Company as inputs and populate NumberOfEmployees and AnnualRevenue as outputs. These are example mappings, not required fields.
priority expresses a field entry's update priority relative to other update rules for the same field. Although its range is defined, the numeric precedence direction is not. Do not assume that 1 wins over 100, or the reverse.
Developer names have naming and visibility restrictions
The developerName values on rules and field mappings must begin with a letter and contain only alphanumeric characters and underscores. They cannot contain spaces, end with an underscore, or contain two consecutive underscores. They must be unique in the org, preventing conflicts between packaged rules or mappings that share a masterLabel.
Viewing, grouping, sorting, or filtering these developerName fields requires either View DeveloperName or View Setup and Configuration permission. This requirement controls visibility of those fields; it does not define who can execute enrichment.
The masterLabel values on the service, rules, and mappings are internal display labels and are not translated. The service requires description, masterLabel, matchEngine, and cleanRules; each rule also requires its own description and label.
Deployment and Retrieval
Use Metadata API retrieval to obtain the metadata describing the enrichment service, then deploy that metadata to configure the service in another org. Avoid CRUD-based Metadata API calls, which operate on individual components through create, read, update, and delete operations. Use the Tooling API for small modifications.
CleanDataService is the deployment unit. Its nested CleanRule and FieldMapping structures have developer names, but those names do not replace the service's inherited fullName.
Component files use the .cleanDataService suffix and reside in the cleanDataServices directory. File naming is based on the object associated with the service. For example, cleanDataServices/DataCloudCompanyMatch.cleanDataService represents the DataCloudCompanyMatch service associated with company-name data in Account objects.
In package.xml, identify the metadata type as CleanDataService. The manifest supports the * wildcard for this type.
Object compatibility errors
The following object selections are documented error causes:
- A nonexistent virtual source object in a rule's
sourceSobjectType. - A
targetSobjectTypethat the particular data service does not support. An object merely existing in Salesforce is insufficient. - An unsupported object in mapping-level or row-level
SObjectType. - A nonexistent object in a field entry's
dataServiceObjectName.
Interpret these checks in the surrounding mapping context. Input mappings can place the virtual service object and Salesforce object on different sides from those suggested by the field descriptions.
Default-component deletion can require separate handling during an org reset. A reported deletion attempt against DataCloudCompanyMatch was rejected, as described under Reported Issues. That report does not establish a deletion restriction for every CleanDataService component.
Relationships
Object and field associations help identify possible dependencies, but mapping context determines which names describe Salesforce objects and which describe virtual service objects. These associations do not mean every virtual service object is a deployable CustomObject, and they do not expand the documented support for standard-object targets.
References
-
CustomObject: rule-levelsourceSobjectTypeandtargetSobjectType; mapping- and row-levelSObjectType; field-entrydataServiceObjectName. -
CustomField: row-levelfieldName; field-entrydataServiceField.
Documentation Inconsistencies
-
mappingOperationcasing and behavior: Salesforce's field definition namesAutoFilland says it adds data only when the object field is blank. The XML example and exposed enumeration instead useAutofill. The enumeration also exposesOverwrite, but that field definition does not explain its behavior. Preserve exact casing, and do not apply the blank-only guarantee toOverwrite. -
Mapping direction: The field definitions describe
SObjectTypeas a standard Salesforce object anddataServiceObjectNameas a service object. However, the input-mapping example places the virtualDataServiceCompanyObjectinSObjectTypeandLeadindataServiceObjectName. Do not assume that every mapping is an output mapping solely from those descriptions.
Reported Issues
-
Deleting a default service can block an org-reset operation. An org-reset answer last edited in 2022 reports that deleting
DataCloudCompanyMatchfailed withYou can't delete default data integration rule. This concerns that default component, not all services. See the default-rule deletion report. -
Tooling API availability does not imply direct Apex query access. A 2021 community inventory reported that
CleanDataService,CleanRule,FieldMapping,FieldMappingRow, andFieldMappingFieldwere unavailable in the ApexSchemanamespace and could not be queried directly in Apex. The report concerns direct Apex queries, not Tooling API access. See the Apex query availability discussion.
Common Questions
How do I retrieve and deploy CleanDataService?
Retrieve the service through Metadata API and deploy the retrieved configuration to the destination org. Use CleanDataService in package.xml; the type supports wildcard retrieval. Files reside in cleanDataServices with the .cleanDataService suffix.
Does saving a data integration rule update existing records?
When that rule's bulkEnabled is true, Salesforce applies it to existing records whenever it is updated or saved. Saving is therefore not necessarily a configuration-only operation.
Do bypassTriggers and bypassWorkflow bypass all automation?
No. Their documented scope is triggers and workflow rules, controlled independently. Neither setting establishes a general bypass of all automation or security.
Does mappingOperation only fill blank fields?
The field definition gives that behavior for AutoFill, while the example and enumeration spell the value Autofill. The enumeration also includes Overwrite, but the field definition does not explain it. Do not assume the blank-only behavior applies to Overwrite.
Why can't I delete DataCloudCompanyMatch?
A community org-reset report records the error You can't delete default data integration rule for that component. It is a report about a default service, not proof that every CleanDataService component is undeletable.