function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pugalagiri JPugalagiri J 

Capture 'Inserted Fields' in Change Event Trigger

In Change Event Trigger, in case of 'UPDATE' operation, updated/changed field names are available in ChangeEvent parameter as below

(Trigger.new).ChangeEventHeader => 
ChangeEventHeader[etChangeFields=(field1,field2,field3)]

Using this info, what all fields are updated and assocaited values can be fetched.

But in case of Change Event Trigger 'CREATE' operation, I doesn't see any tag/parameter with list of fields (Field Name) inserted.
Is there anyother we can identify list of fields which are inserted.

Note: Trigger.New have all field name and values (i.e.,null and values) but I need to know only the fields which are inserted so that those values alone can be fetched.
Pugalagiri JPugalagiri J
Found this info https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_event_fields_body.htm

Apex Change Event Messages
Fields in a change event message are statically defined, just like in any other Apex type. As a result, all record fields are available in the change event message received in an Apex trigger, regardless of the operation performed. The event message can contain empty (null) fields.
Create
For a new record, the event message contains all fields, whether populated or empty. It includes fields with default values and system fields, such as CreatedDate and OwnerId.
Update
For an updated record, the event message contains field values only for changed fields. Unchanged fields are present and empty (null), even if they contain a value in the record. The event message also contains the LastModifiedDate system field. The body includes the LastModifiedById field only if it has changed—if the user who modified the record is different than the previous user who saved it.
Delete
For a deleted record, all record fields in the event message are empty (null).
Undelete
For an undeleted record, the event message contains all fields from the original record, including empty (null) fields and system fields.

Let me know if any have a way to identify only the fields which are inserted in Create operation