How to Import Attachments with Data Loader in Salesforce

In Salesforce CRM, we have a robust data management tool, Data Loader, which allows us to import, export, and manage data within their Salesforce org. One crucial aspect of data management is handling attachments, which can include documents, images, and other files associated with records.

In this Salesforce tutorial, we will learn to import attachments with a data loader in Salesforce.

Importing Attachments with Salesforce Data Loader

With the help of the Salesforce data loader, we perform operations of insert, export, delete, and update. The Data loader also allows us to upload attachments like images and documents to the object data. For example, you are adding images and pdf to an Account object record.

The import of the attachments is done with the Insert operation. But unlike creating a CSV file with a Column header of data fields, in this case, we have to create a CSV file that defines the type of the attachment document with its specified location in our system.

In the below steps, we will learn to create a CSV file to import attachments, and then we will upload these attachments in the Record’s data using the insert operation.

Import Attachments with Data Loader in Salesforce

To import attachments with Data Loader in Salesforce, make sure you have installed the Data Loader in your system and also have the required access to edit the data of records.

Now follow the below steps, if you meet the above conditions.

See also  How to Delete the Records Using Data Loader in Salesforce

In this example, I will take an Account object record to explain the importing and uploading of attachments with a data loader.

1. First, we will create a CSV file with the header columns ParentId, Name, and Body. In the column ParentId enter the ID of the record in which you have to upload attachments.

If you are unable to find the ID of the record, then go to the Account (object) -> Select the record, then from the URL, copy the 15-digit number starting from zero.

Import attachments with Salesforce Data Loader

2. Now enter that copied ID in the header column ParentID. In the column Name enter the type of attachment like, image, document, pdf. In the column Body, we have to enter the path of the attachments where it is saved in our system.

Now save this CSV file from where it can accessed to the data loader.

Create a CSV file to import Attachment with data loader

3. Open the data loader and log in with your credentials.

4. In the data loader wizard, click on the Insert button.

Insert attachments with Salesforce Data loader

5. In this step, activate the checkbox Show all Salesforce objects, then select the data object Attachment.

After this, browse the CSV file that we have created in the above steps, then click on the Next button.

Upload Attachments to records with Salesforce Data Loader

6. As we click on the Next button, the data loader will initialize the selected CSV file. Here, click on the OK button.

Use data loader to import attachments in Salesforce

7. In this step, we will map the data object field names with header columns of the CSV file, and for that, click on the button Create or Edit a Map.

See also  How to Insert or Update Price Books with Data Loader in Salesforce

Then, in the next window, click on the button Auto-Match Fields to Columns. As we click on this button, the field names will be auto-matched with header columns. In case they are not auto-matched, then you have to drag the object fields to the column mapping.

After mapping, click on the OK button, then click on the Next button to proceed.

Import attachments in records with Salesforce Data Loader

8. In this step, select the location to save the success and error files of the import operation from where it can be accessed later.

At last, click on the Finish button.

Bulk Import attachments with Salesforce Data Loader

9. As we click on the Finish button, a warning message will appear on the screen regarding the insert operation. Here, click on the Yes button to proceed.

Salesforce import bulk attachments with data loader

10. After the completion of the insert operation, we can see the success and errors that occurred in the insert operation. Here, click on the OK button to close the data wizard.

Import attachments in bulk with Salesforce Data Loader

11. Navigate to the record in which you have inserted the attachments and go to the section Notes & Attachments.

In this example, I have inserted the attachments in the Account record Cardone technologies, and in the section Notes & Attachments, we can see the inserted attachments.

Import Mass attachments with Salesforce Data Loader

As we can see in the above image, the attachments are successfully inserted into the selected object record.

In this way, we can upload and insert attachments to the records using the Salesforce Data Loader by following the above steps.


In Salesforce data management, importing attachments with Data Loader can significantly enhance your data management processes. By following the above steps, you will able to import and insert the attachments to the records of data objects and efficiently migrate and associate attachments with relevant records.

See also  How to Import Opportunity Contact Roles with Data Loader in Salesforce

You may like to read: