Message Image  

Download Salesforce attachment or document content by using App Connect on IBM Cloud

 View Only
Tue July 07, 2020 04:19 AM

Using IBM App Connect on IBM Cloud, you can easily download the content of Salesforce attachments or content documents as part of your business flows. In this article, we explore how this feature works along with a use-case example.

Introduction: Salesforce Attachment or Content document

When you upload a file to Salesforce the “Notes & Attachments” list on records, the type of Salesforce object saved depends on the user experience you select; Classic or Lightning:

  • Classic: Files are saved as Attachments (for use in the record that they are attached to).
  • Lightning: Files are saved as Content documents (as Salesforce Files, for possible sharing and other use outside the record).

Salesforce file content download actions in App Connect

In App Connect, there are two actions for downloading Salesforce file content:

  • Download attachment content
  • Download content document content

The Download attachment content action takes the Attachment ID as input, and the response is the base64-encoded file content.

The Download content document content action takes the ContentDocument ID as input, and the response is the base64-encoded file content. Note: App Connect downloads the latest version of the content document.

Use case:

An Integration Developer intends to download attachments for each account in Salesforce and upload the content to a new file in Box.

The Integration Developer creates a flow for an API that performs a sequence of actions:

  1. Queries all Salesforce accounts
  2. For each account, gets the list of attachments
  3. For each attachment, download the content, and then upload as a new file to a Box folder.

Flow snapshot: