Flow Actions

Get Attachments

Introduction

The CloudFiles: Get Attachments flow action allows you to retrieve all the Resource (files or folders) connected to a Salesforce record through CloudFiles. These linked resources, referred to as "Attachments," could have been connected using the Create Attachment action or are connected manually to a Salesforce record via the CloudFiles widget.

This action can be used to fetch a collection of these attachments in a Salesforce Flow.This is particularly useful when managing multiple resources connected to a single record.

Note: If a record has only one connected folder, and you want to retrieve its details, it is more efficient to use the Get Connected Folder action instead.

What this action does

The Get Attachments action takes the Salesforce Record ID as an input and outputs a collection of all attachments linked to that record. Each attachment includes metadata details of the connected resources, enabling advanced flow configurations and automation.

Example Use Case

An Account record has multiple attachments linked via CloudFiles. You can use the Get Attachments action to retrieve all these attachments. This collection can then be used for further processing, such as:

  • Deleting all attachments related to a Lead, identified by a specific naming convention like "Lead" in their terms.
  • Archiving or moving these resources to another location based on workflow triggers.

Input Parameters

Parent ID

The Salesforce Record ID for which attachments need to be retrieved.

Output Parameters

The apex action outputs apex-defined Attachment Collection.

Each Attachment in the collection,

  1. Record ID
    • The Salesforce RecordId.
  2. Resource Properties
    1. Resource ID: External ID of the resource.
    2. Name: Name of the attached resource.
    3. Path: The path of the resource in external storage.
    4. Type: Type of the resource ("file" or "folder").
    5. Library: External storage service used.
    6. Drive ID: Relevant for Google Drive or SharePoint.