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.
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.

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.

3. Open the data loader and log in with your credentials.
4. In the data loader wizard, click on the Insert button.

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.

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

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.
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.

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.

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.

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.

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.

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.
Conclusion
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.
You may like to read:
- How to Insert Null or Blank Values with the Salesforce Data Loader
- How to Assign Permission Sets to Users in Salesforce
- How to Attach Files to the Records in Salesforce
- How to Subscribe to Reports in Salesforce
- How to Import Leads as Campaign Members with Data Loader in Salesforce
- How to Assign Permission Sets using Data Loader in Salesforce

Abhijeet is a skilled Salesforce developer with experience in developing and integrating dashboards, data reports, and Salesforce applications. He is also skilled at optimizing processes and flow automation processes, coding, and executing complex project architecture. Read more about us | LinkedIn Profile.