Migrate Change Data Capture Entity Selections with Metadata API

Retrieve and deploy the selected entities for change notifications with the PlatformEventChannel Metadata API type.

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

How: This PlatformEventChannel component represents three selected objects: Account, Contact, and the Employee__c custom object. It contains the event names of the corresponding objects.

<?xml version="1.0" encoding="UTF-8"?>
<PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
    <channelMembers>
        <selectedEntity>AccountChangeEvent</selectedEntity>
    </channelMembers>
    <channelMembers>
        <selectedEntity>ContactChangeEvent</selectedEntity>
    </channelMembers>
    <channelMembers>
        <selectedEntity>Employee__ChangeEvent</selectedEntity>
    </channelMembers>
    <channelType>data</channelType>
    <label>ChangeEvents</label>
</PlatformEventChannel>