Platform Events
All Event Types

Resource Attached Event

Overview

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.

How To Use This Event ?

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.

Document image


Event Type For Decision Filter

Please use resource-attached as the type filter when selecting this event in the decision element in flow builder.

Output Fields From Get Event Details

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.

Document image

  1. Resource - A resource represents a file or a folder in external storage.
  2. Object Type - Type of the Salesforce record where the resource is attached. The Object's API Name.
  3. Record Id - Id of the Salesforce record where the resource is attached.

Use Cases

In this section we present some use-cases for this platform event.

  1. Create a list of all manual attachments done by team members on various records to get a report of content consumption against record types.
  2. Read the files of the attached resource and determine if certain file types have been uploaded to advance opportunity status.
  3. Copy the attached record files from Salesforce storage to external storage for migration or archival, and optionally delete them from salesforce.