File Viewed Event
This event is published when a file is viewed through the sharing link generated by CloudFiles in Salesforce. The file sharing link can be obtained through CloudFiles widget in salesforce. The file-viewed event type can be used to filter this event. The corresponding Get Event Details flow action returns the File Viewed sub-type with useful information including file resource, record Id, email, time spent, link and download status 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 file-viewed as the type filter when selecting this event in the decision element in flow builder.
The corresponding Get Event Details flow action returns the File Viewed sub-type with useful information including file resource, record Id, email, time spent, link and download status for further use. Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.
- Link - Link contains "url" and "id" field in form of a list.
- Resource - A Resource consists driveId, name, Id, path, library and type of the file that is being viewed.
- downloaded - It is a boolean to indicate whether the file in view is downloaded through the link or not.
- TimeSpent - Amount of time (in seconds) spent on the file which has been viewed.
- Email - Email through which file is viewed by.
- RecordId - Record Id of the record to which file belongs.