Newer Version Available

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

Example: Add Event Enrichment Fields with Metadata API

To add event enrichment fields, use the PlatformEventChannelMember metadata type, and specify the fields, the channel, and channel member.

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.

Note

If the channel member you are enriching is part of a custom channel, create the custom channel first, as shown in this example. You can skip this step if using the ChangeEvents standard channel, or if you created the custom channel earlier.

This sample metadata component is for a custom channel.

This package.xml references the previous definition. The custom channel name is SalesEvents__chn.

To add enrichment fields, deploy the PlatformEventChannelMember component containing the enriched fields. In this example, the component contains two enriched fields for AccountChangeEvent on the SalesEvents custom channel. External_Account_ID__c is a custom field defined in your org.

Use this package.xml manifest file to deploy or retrieve the channel member definition. Only API version 48.0 and later is supported.

If the member is already part of the channel, you can update it with enriched fields by redeploying the PlatformEventChannelMember component with an updated definition.

Note