Salesforce File Copied Event
This event is published when a Salesforce file is copied to external storage by Copy Salesforce Files flow action. This event works for all CloudFiles supported storages. The event type salesforce-file-copied can be used to filter this event. The corresponding Get Event Details flow action returns the Copied Salesforce File Details sub-type with useful information including source file id, destination file id, record id etc... for further use.
This event only triggers when the Copy Salesforce Files action was used to initiate the copy of the file to the external storage.
To use CloudFiles Platform Events, you must first setup your platform event triggered flow as shown in the CloudFiles Event Handler Flow Template. This article will introduce you to the concepts of the event type in the CloudFiles Event Object as well as event details that are returned by the Get Event Details flow action.
Once you are familiar with these, you will understand how to interpret & use these as illustrated in the sections below.
Please use salesforce-file-copied as the type filter when selecting this event in the decision element in flow builder.
The Get Event Details provides the Copied Salesforce File Details sub-type to output the information for this event. It provides useful information including source file id, destination file id, record id etc... for further use.
Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.
- Parent Id - Id of the Salesforce record where the Salesforce file was uploaded. Along with the Object Type returned by the CloudFiles Event Object , this can point to a specific record in your org.
- ContentVersionId - Id of associated ContentDocumentLink -> ContentDocument -> ContentVersion. in your Salesforce that got copied. This basically refers to the Salesforce file that got copied. Note that Salesforce has a complex file storage mechanism. Make sure you understand the Content Document architecture of Salesforce to use this field.

In this section we present some use-cases for this platform event.
- Mark the Salesforce file as copied after it has been copied into SharePoint.
- Delete a file from Salesforce after it has been successfully copied into SharePoint.
- Update the initiating record fields to mark it for scheduled deletion of stored files