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.
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:
- Queries all Salesforce accounts
- For each account, gets the list of attachments
- For each attachment, download the content, and then upload as a new file to a Box folder.