Enrich Change Event Messages with Extra Fields (Beta)

With Change Data Capture Enrichment, you can select fields to always include in change events, even when unchanged, to aid in processing or replicating data. For example, use enrichment when your replication app needs an external ID field for matching records in an external system. Change Data Capture Enrichment is supported in CometD-based subscribers. Change Data Capture Enrichment was offered last release, and in this release, we added support for compound fields, such as the Lead Name, Address, and geolocation fields.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

Note

Note

As a beta feature, Change Data Capture Enrichment is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Change Data Capture Enrichment in the Trailblazer Community. For information on enabling this feature in your org, contact Salesforce.

How: You define enrichment fields on a channel and a member of that channel. The channel can be either a custom channel or the ChangeEvents channel. Enriched change events are delivered only on the channel that is configured for enrichment. To add enrichment fields to a channel member and channel, use the PlatformEventChannelMember object in Tooling API or Metadata API.

This example uses Tooling API to enrich the AccountChangeEvent member on the SalesEvents__chn custom channel. The change event is enriched with two fields: a custom field (External_Account_ID__c) and a standard field (Industry). The associated POST request URI is: /services/data/v49.0/tooling/sobjects/PlatformEventChannelMember

Request Body:

{
  "FullName": "SalesEvents_AccountChangeEvent",
  "Metadata": {
    "enrichedFields": [
      {
        "name": "External_Account_ID__c"
      },
      {
        "name": "Industry"
      }
    ],
    "eventChannel": "SalesEvents__chn",
    "selectedEntity": "AccountChangeEvent"
  }
}