File Replaced
This event is published when an External Storage File is replaced using CloudFiles LWC from within Salesforce.
For example, replacing a SharePoint's file with another file uploaded from local PC.
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 file-replaced as the type filter when selecting this event in the decision element in flow builder.
The corresponding Get Event Details flow action returns the Replaced File Details sub-type with useful information including replaced file details, RecordId and UserId for further use.
Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.
- DriveId - The Drive ID of the replaced File
- Id- The ResourceId of the replaced File. (When a file is replaced ResourceId doesn't change)
- Library- The External Storage Library (Ex sharepoint)
- Name- The Name of the replaced File (Old File's Name)
- ParentFolderId - The ResourceId of the replaced File's ParentFolder
- RecordId - The Salesforce Record ID associated with the LWC that initiated the the update.
- UserId - The Salesforce User ID of the user who performed the update.