PlatformEventChannelMember selects one entity for Change Data Capture (CDC) notifications on a standard or custom channel, or one platform event on a custom channel. CDC notifications describe changes to Salesforce records. Each selected entity on a channel has its own PlatformEventChannelMember component.
This type defines membership, not the channel itself or a live subscriber connection. PlatformEventChannel defines the channel. The member connects a selected event to that channel and can configure filtering and CDC payload enrichment, which adds selected field values to change events.
Key Elements
| Element | What the Element Controls |
|---|---|
eventChannel |
Required. Identifies the channel: ChangeEvents for the standard CDC channel, or a custom channel name such as SalesEvents__chn. Platform-event selections use custom channels. |
selectedEntity |
Required. Identifies the selected event. For CDC, use AccountChangeEvent for Account or MyObject__ChangeEvent for MyObject__c, not the underlying object's API name. A platform-event selection can use a name such as MyPlatformEvent__e. |
filterExpression |
Restricts delivery to events matching a SOQL-based expression. It supports only a subset of SOQL operators and field types; it is not a complete SOQL query. For example, City__c = 'San Francisco' selects events containing that field value. |
enrichedFields |
Contains one or more fields selected for CDC enrichment. For CometD subscribers, non-empty selected fields are included in update or delete change events even when those fields did not change. |
name |
Nested inside each enrichedFields entry. Identifies the field to include in the enriched payload and can reference CustomField metadata. |
fullName |
Inherited component identity used in manifests and destructive changes. It is also the component file name without its extension. It identifies the member, not just its channel. |
Behavior and Constraints
Channel membership and filtering
A channel with multiple selected entities requires multiple member components. For example, selecting both Lead and Contact on ChangeEvents produces separate members for LeadChangeEvent and ContactChangeEvent.
Changing filterExpression changes which events consumers of the channel can receive. Expressions can contain one or more field-value conditions, but normal SOQL syntax and field support do not automatically apply. Salesforce documents the restrictions separately for platform-event filtering and change-event filtering.
Enrichment does not mean a field changed
For CDC subscribers using CometD, enrichment adds selected fields with non-empty values to update or delete change events even when those fields did not change. A consumer must not interpret the presence of an enriched field as proof that its value changed. See CDC enrichment behavior.
Lookup enrichment should not be treated as a request for related-record attributes. A June 2023 community answer describes support for the relationship field itself, returning the related record ID, but not traversal to fields such as Account.Name or CreatedBy.Name. Custom relationship fields use their __c names, such as RelField__c.
Deployment and Retrieval
Deploying or retrieving PlatformEventChannelMember requires the Customize Application permission.
In Metadata API file format, components reside in the platformEventChannelMembers directory and use the .platformEventChannelMember suffix. For example, ChangeEvents_LeadChangeEvent.platformEventChannelMember has the component fullName ChangeEvents_LeadChangeEvent.
Use the member's full name
In package.xml, list members under the PlatformEventChannelMember type using their fullName, not the channel name alone. This type also supports the * wildcard in the manifest.
Two consecutive underscores in a component fullName are reserved for a component suffix or namespace prefix. They are not supported as arbitrary interior separators. When embedding a custom channel name in a member name, replace its double underscore with a single underscore.
eventChannel |
selectedEntity |
Example member fullName
|
|---|---|---|
ChangeEvents |
LeadChangeEvent |
ChangeEvents_LeadChangeEvent |
SalesEvents__chn |
AccountChangeEvent |
SalesEvents_chn_AccountChangeEvent |
SalesEvents__chn |
MyCustomObj__ChangeEvent |
SalesEvents_chn_MyCustomObj_ChangeEvent |
These naming adjustments affect only the member identity. Keep the actual channel name SalesEvents__chn in eventChannel and the actual event name, including its double underscores, in selectedEntity. Do not use SalesEvents__chn_AccountChangeEvent as the member name.
Retrieve channels and members separately
A custom channel and its members are separate metadata components. To retrieve both in one request, include separate type entries in package.xml:
-
PlatformEventChannel, with a member such asSalesEvents__chn. -
PlatformEventChannelMember, with members such asSalesEvents_chn_AccountChangeEventandSalesEvents_chn_MyCustomObj_ChangeEvent.
Remove membership through destructive deployment
The Metadata API createMetadata() and deleteMetadata() calls are not supported for this type. Use file-based deployment to manage member components.
To remove a member from a channel, deploy destructiveChanges.xml with a PlatformEventChannelMember type entry and the member's fullName. For example, deleting the Lead selection from the standard channel targets ChangeEvents_LeadChangeEvent, not ChangeEvents.
Tooling API record deletion is a different operation from Metadata API deleteMetadata(). The community deletion report below uses a record-specific Tooling API endpoint and a record ID, not the metadata fullName or a developer name.
Relationships
The member connects a channel to a selected event entity. Enrichment entries can also identify custom fields on that entity. These element references are separate from the naming convention used to construct the member's fullName.
References
-
PlatformEventChannel:eventChannel. -
CustomObject:selectedEntity. For CDC, the stored value is the change-event name rather than the underlying object's API name. -
CustomField:name, nested inenrichedFields.
Reported Issues
-
Missing related-record attributes can be an enrichment limitation rather than a missing lookup value. A June 2023 answer reports that lookup enrichment returns the related record ID and does not traverse to attributes such as
Account.NameorCreatedBy.Name. It also specifies__cnames for custom relationship fields. Lookup enrichment discussion. -
A failed REST deletion can indicate the wrong endpoint rather than an inability to remove membership. A March 2021 answer reports successful Tooling API
DELETEagainst the record endpoint ending in/tooling/sobjects/PlatformEventChannelMember/{Id}, after collection and incomplete paths had failed. The identifier is the Tooling API record ID. This does not establish support for Metadata APIdeleteMetadata(). Tooling API deletion discussion. -
A proposed record-type filter was not applicable to a platform event. In a November 2023 answer to a subscription-filtering question, the responder noted that platform events do not have record types. The answer described configuring
filterExpressionon a member of a custom channel through the Tooling API and reported that there was no UI for that configuration. Platform-event filtering discussion.
Common Questions
How do I retrieve a custom event channel and all its members?
Include separate PlatformEventChannel and PlatformEventChannelMember entries in package.xml. Reference the channel by its channel name and each member by its fullName. The member type supports the * wildcard.
What name should I use for a custom channel member?
Use the member's fullName, such as SalesEvents_chn_AccountChangeEvent. Keep SalesEvents__chn in eventChannel; the single-underscore adjustment applies to the member identity, not the stored channel name.
How do I delete a PlatformEventChannelMember?
Deploy destructiveChanges.xml containing the PlatformEventChannelMember type and the member's fullName. Metadata API deleteMetadata() is unsupported. A separate community report describes Tooling API deletion using the record-specific endpoint and record ID.
Should selectedEntity contain Account or AccountChangeEvent?
For CDC, use AccountChangeEvent. For a custom object such as MyObject__c, use MyObject__ChangeEvent, not the underlying object's API name.
Can enrichedFields include Account.Name or CreatedBy.Name?
The June 2023 lookup-enrichment report says relationship traversal is not supported. Enrich the relationship field itself to receive the related record ID; use the __c field name for a custom relationship. Also, an enriched field appearing in a payload does not prove that its value changed.