Resource Attached
This event is published when a file/folder in external storage is attached to a Salesforce record. The resource-attached event type can be used to filter this event. The corresponding Get Event Details flow action returns the Resource Attached sub type with useful information including file resource, object type and record id for further use.
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 resource-attached as the type filter when selecting this event in the decision element in flow builder.
The corresponding Get Event Details flow action returns the Resource Attached sub-type with useful information including file resource, object type and record id for further use. Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.
- Object Type - Type of the Salesforce record where the resource is attached. The Object's API Name.
- Record Id - Id of the Salesforce record where the resource is attached.
In this section we present some use-cases for this platform event.
- Create a list of all manual attachments done by team members on various records to get a report of content consumption against record types.
- Read the files of the attached resource and determine if certain file types have been uploaded to advance opportunity status.
- Copy the attached record files from Salesforce storage to external storage for migration or archival, and optionally delete them from salesforce.