Content Version Created
The Content Version Created Event is published when a Create Salesforce File flow action successfully creates a Salesforce File (Content Document) from an external storage file. This event is particularly useful in scenarios where the creation of Salesforce Files 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.
Please use content-version-created as the type filter when selecting this event in the decision element in flow builder.
The corresponding Get Event Details flow action returns the Content Version Created sub-type with useful information including the created Salesforce File's ContentVersionId, corresponding External Storage File's metadata details, File Name and ParentId (i.e. recordId input in the corresponding Create Salesforce File action). Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.
- File - A lookup Field of type Resource ( cldfs_Resource )which shall contain the external storage file's metadata details.
- driveId - The external storage drive ID of the file.
- id- The unique resource ID of the file in external storage.
- library- The External Storage Library (Ex sharepoint)
- name- The Name of the File
- path- The Storage Location Path of the File (Null if the storage is Google Drive)
- type- Always file
- FileName - The created Salesforce File's Name
- ParentId - The Text string input in the corresponding Create Salesforce File action. (e.g., the Record ID or any other identifier provided during the action).