Events
Intercepting CloudFiles Events
Custom Object Mode Flow Setup
introduction to use cloudfiles events, you can setup a record triggered flow using the cloudfiles event custom object this object can then be filtered based on type and triggering object, and then passed to the very useful get event details docid\ cfegghvnwso7bcxyevrr flow action which provides the exhaustive list of event details this article explains the process of setting up this flow we first provide a small summary of how to set up this flow before giving a comprehensive step by step guide with screenshots summary we will follow 3 steps to setup the cloudfiles event handler create an empty record triggered flow with the cloudfiles event object as the trigger create a decision element to filter flow executions based on event & object types use the output of the get event details flow action to process the event here is how our final flow looks follow the steps in the next section with screenshots for detailed information step by step guide 1 create a record triggered flow salesforce provides many types of flows e g platform event triggered flows, auto launched flows etc record triggered flows are another type of flow that can be set up using the salesforce flow builder to create a recpord triggered flow, go to the salesforce flow builder, create a new flow and select the type as record triggered flow as shown in the screenshot below once the flow is created, you will be asked to choose a object which would trigger this flow select the "cloudfiles event" from the list of events as shown below make sure to check the box to run the flow in asynchronous mode, as cloudfiles events only execute along the asynchronous path with this, you now have empty record triggered flow set to trigger whenever a cloudfiles event record is created in the next section, we will learn how to filter based on the event type and other parameters this must be done before moving to the further step of making a callout to receive the event details 2 add a decision element on the cloudfiles event object now that we have a record triggered flow setup, it will trigger on every cloudfiles event it is necessary to filter based on event type to receive the event details correctly it is also important to filter based on the object types where you need this flow to trigger these decisions can be set up using two important fields provided by the cloudfiles event object itself this is shown in the image below the cloudfiles event object is the 'record' on which the record triggered flow, triggers this record can have very limited information due to certain salesforce restrictions for this reason, cloudfiles event object only carries 2 important fields type this refers to the type of event e g file uploaded, salesforce file attached, etc a full list is provided in our article for all event types docid 85vg5ndkui9u58vkafhw3 object type – this refers to the api name of the salesforce record type on which you want to intercept these events for example, to intercept file uploads into the salesforce files component on account records, you would use t ype = salesforce file attached and object type = account for some event types, you will not get the object type value through this field instead of relying on it, we recommend performing the object type check using the output from the get event details flow action, as shown in the image below this object does not does not carry any actual details related to the event refer to the next step for this there are other fields as well but they are not meant for your use for a full reference, refer the article on cloudfiles event custom object it is important to note that the actual details of the event are not present in the cloudfiles event object the get event details flow action is used to get the actual event details refer to the next step for more info on this at this point, we have a record triggered flow that only continues under certain conditions now, in order to actually do something useful with this flow, we will see how to get & interpret the event details check out the next step 3 get event details using the flow action in this step, we will use the flow action get event details docid\ cfegghvnwso7bcxyevrr to get the data related to the event this data can be used in further flow elements for example, on file upload, you may want to create a custom object record to save some file metadata such as the file name, extension, external storage url, date of upload etc in order to use this action, simply insert the flow action named "get event details" and configure it as shown below the action takes a single input which is the triggering record (i e the cloudfiles event object we discussed in the above step) you don't need anything else to use this action the output to this flow action can further be used in the flow as shown below, this action outputs a variable which has an output for each type of cloudfiles event depending on the event type, you can check the individual outputs and use them in your processes e g you can intercept the file uploaded event to capture the file name and the folder uploaded event to capture the folder name for a full reference to this flow action, refer to the get event details docid\ cfegghvnwso7bcxyevrr flow action for a full reference to all the event types and the related outputs, refer to all event types docid 85vg5ndkui9u58vkafhw3