Exporting Salesforce Attachments for Specific Object

In this tutorial we will show how to export Salesforce attachments for a specific object. In our example, we will export attachments for Account object.

ExpandedToggleIcon        Creating Connection

If you haven't created the Salesforce connection, you need to create one first. To create a connection to Salesforce, perform the following steps:

1.Click Connections in the menu on the left side of the page to switch to the Connections page.
2.On the Connections page click the New button.
3.In the opened pane click Salesforce.
4.Specify the connection Name, for example, Salesforce1.
5.From the Environment drop-down list select the Salesforce environment type to import data to.
6.From the Authentication drop-down list select the authentication method for connecting to Salesforce. If you don't mind storing your Salesforce credentials on our Skyvia server, select User Name & Password. If you prefer not to store your credentials, select OAuth 2.0.
7.If you have selected User Name & Password, on the previous step, specify your Salesforce account e-mail, password, and security token. Otherwise, if you have selected OAuth 2.0 authentication, click the Log In with Salesforce button and login via the Salesforce website on the opened page. The result OAuth token will be stored in the connection data. Your Salesforce credentials will not be stored on our website.
8.Click the Save button to save the connection.


ExpandedToggleIcon        Creating Package

Now let's create the corresponding export package.

1.Click Integration in the menu on the left.
2.Click the New button in the top right corner of the page.
3.Click Export.
4.In the Source header click Select and select Salesforce in the drop-down list.
5.Select Salesforce1 in the Source Connection drop-down list.
6.Click the + Add task to open the Task Editor.
7.From the Object drop-down list select Attachment.
8.Select the check box near Attachment to export all the Attachment fields.
9.After this, let's filter the export results by the attachment parent objects. In our case, we want to export attachments with Account parents. For this click Add Condition under Filter.
10. In the first list of the added condition select Parent.
11. In the second list select Type.
12. In the last list of the condition select Account. After this, our package will export only attachments with Account parents. You can save the task and the package and run it for execution if this is enough. However, let's demonstrate a case, when you need to export attachments for a specific account.
13. Click Add Condition under Filter once again.
14. In the first list of the added condition select Parent.
15. In the second list select Name.
16. Enter the name of the account into the rightmost box of the condition. In our case it's 'Edge Communications'.
17. Click the Save button at the bottom of the Task Editor.
18. Click the Save button in the package header.
19. Run the package.

When you export data to a CSV file to your PC, you can download the result file by clicking the number of exported rows in the package Run History.


Note that when you export attachments to a CSV file to your PC, the result will be a zip archive, containing the result CSV file together with the attachment binary files.

note Note

When you export data to a CSV file to your PC, the files are available for download for 7 days.