How to import attachments using data loader in salesforce?



How to import attachments using data loader in salesforce?..

Answer / Sumit Kudesia

To import Attachments using Data Loader, first export the Attachment object and then create a CSV file for Attachments. Here's an example for a simple scenario:

1. Export Attachments: Go to Setup > Data > Data Export, select Attachment, choose the desired date range (Last Month/30 Days) and click on 'Export Now'. Download the `unfilteredAttachments.csv` file.
2. Create a CSV file for Attachments: Open the downloaded `unfilteredAttachments.csv` file, remove unnecessary columns, and keep only required columns like: ContentType, BodyLength, ParentId, Uid, IsPrivate, Subject, whatId, CreatedDate, LastModifiedDate, SystemModstamp.
3. Prepare Attachment Data: Add the new attachment data as follows:
```makefile
ContentType,BodyLength,ParentId,Uid,IsPrivate,Subject,whatId,CreatedDate,LastModifiedDate,SystemModstamp,Attach_Data__c
text/plain;charset=UTF-8,23,"001a0000005A000","600100000008777","false","Test Attachment","001a0000005A000",2022-01-01T00:00:00.000Z,2022-01-01T00:00:00.000Z,2022-01-01T00:00:00.000Z,"Base64Encoded Attachment Data"
```
Replace `Base64Encoded Attachment Data` with the Base64 encoded data of your attachment.

4. Import Attachments: In Data Loader, select 'Attachments' as the object and load your prepared CSV file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

Do I always create an app bundle first when develop lightning component ? : salesforce lightning component

1 Answers  


Can we include external javascript/css libraries in components?

1 Answers  


What is a Sharing Rule?

1 Answers  


How to call parent component method from child component without using events? : salesforce lightning component

1 Answers  


What is Approval Processing?

1 Answers  


How do you implement soap web services in apex ?

1 Answers  


What is trend report? : salesforce admin

1 Answers  


What all data type can be used as controlling fields? : salesforce objects & fields

1 Answers  


How do users see report headers while scrolling? What to do to enable this floating report header?

1 Answers  


Can you use sharing rules to restrict data access?

1 Answers  


Does lightning work with visualforce ?

1 Answers  


How many certifications are available in salesforce?

1 Answers  


Categories