Enrich Change Event Messages with Extra Fields (Beta)
Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.
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"
}
}

