Download Binary Files Using a URL or Record Identifier with the Download Attachment Operation
The Salesforce REST Adapter does not facilitate downloading of binary files while performing CRUD operations. To retrieve these files, you must use the Download Attachment operation provided by the Salesforce REST Adapter. This use case describes how to download binary files by using a URL or record identifier.
Download Using the URL
You can obtain the Blob URL by using the existing Salesforce REST Adapter functionality (SOQL/SOSL query or retrieve). You can then use this URL as input and download the binary file content. Follow these steps for more details.
- Create a schedule integration
- Configure a schedule parameter (for this example, named ParentId).
- Drag the Salesforce REST Adapter as an invoke connection into the integration canvas.
- On the Action page, select Query Information.
- Select SOQL/SOSL Query as the operation type.
- Enter a valid SOQL query for binary large objects
to retrieve the Id,
Name, and
Body using
ParentId, or
Name as a query
condition/binding parameter.

- If there are multiple attachments on
ParentId, then perform the
Download Attachment
operation for each attachment.
- Drag a for-each action into the integration canvas.
- Add the Salesforce REST Adapter.

The for-each action looks as follows:

- On the Action page, select Download Attachment.
- On the Operations page, select Download Using URL as the operation type.
- In the mapper, map the source
Body element under
Attachment response to the
target File URL element.

- Drag an FTP Adapter into the integration canvas after the map action.
- Use the File URL value obtained from the above step to write the file to any FTP location.
- If there are multiple attachments on
ParentId, then perform the
Download Attachment
operation for each attachment.
- Click Business Identifiers
to specify the tracking variable.
- Activate and run the integration.
Download Using the Record Identifier
You can use this operation to download binary file content of a specific record. Follow these steps for more details.
- Create a schedule integration
- Drag the Salesforce REST Adapter to the integration canvas.
- On the Action page, select Download Attachment.
- On the Operation page, select Download Using Record Identifier as the operation type.
- Select the object that supports the blob field.
- Select the blob field associated with the selected business object.
- In the mapper, map the source Attachment
ID element to the Record
Id element.

- Click Business Identifiers
to specify the tracking variable.
- Activate and run the integration.