Platform Events
All Event Types

Document Generated

Overview

This event is published for every document generated using the Generate Document or Generate Document (Batch) flow action.

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 document-generated 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 Document Generated details with useful information including file resource, contentversionId, name and parentId for further use. Refer to the image below for a list of outputs:

Document image




  1. File - This field specifies the metadata details of the generated file.
    1. This parameter is populated only if the Destination input parameter was configured in the corresponding Generate Document action. If not, it will be null.
    2. Field Details:
      1. When saved in Salesforce and linked to a record:
        • id: The generated file's Content Document ID.
        • library: salesforce.
        • Other fields will be null.
      2. When saved in external storage:
        • Contains metadata details of the file stored in the external storage.
  2. ContentVersionId - This is the content version Id of the file that is generated.
    1. If no Destination parameter is specified in the corresponding Generate Document action, the file is stored in the Salesforce File Library.
    2. This field holds the Content Version ID of the generated file in Salesforce.
  3. Name - The name of the generated document.
  4. ParentId - Record Id on which the document is generated.