Resource Deleted
The Resource Deleted Event is triggered whenever a resource (file or folder) is deleted using the CloudFiles LWC (Lightning Web Component).
This event is particularly useful in scenarios where the deleting of Resources needs to initiate downstream processes or workflows.
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.
In Flow Builder, use the resource-deleted event type as a filter condition in decision elements. This ensures the Flow is triggered only for deleted resource events.
The corresponding Get Event Details Flow action extracts relevant information about the Deleted Resource and the Context of the deletion.
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 deleted Resource's metadata details.
- driveId - The external storage drive ID
- id- The ResourceId or unique identifier of the deleted resource.
- library- The External Storage Library (Ex sharepoint)
- name- The name of the deleted file or folder.
- path- The Storage Location Path of the File/Folder (Null if the storage is Google Drive)
- type- file or folder based on the deleted Resource Type.
- RecordId - The Salesforce Record ID associated with the LWC that initiated the deletion.
- UserId - The Salesforce User ID of the user who performed the deletion.