Salesforce File Copied
This event is published for every Salesforce File that is copied to external storage by using the Copy Salesforce Files flow action. This event works for all CloudFiles supported storages.
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.
- Resource - A lookup Field of type Resource ( cldfs_Resource )which shall contain the External Storage Resource's metadata details.
- driveId - The external storage drive ID
- id- The unique resource ID
- library- The External Storage Library (Ex sharepoint)
- name- The Name of the File/Folder
- path- The Storage Location Path of the File/Folder (Null if the storage is Google Drive)
- type- file or folder based on the Resource Type.
- ParentId - The Text string input in the corresponding Copy Salesforce Files action. (e.g., the Record ID or any other identifier provided during the action).
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