function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raghav TRaghav T 

Can we import EmailMessage records through data loader?

Hi there,

I have a task to export all email under case object and move to other org and import all those emails there.
So can we do this with data loader to achieve this scenario? Or Else?

Thanks
Best Answer chosen by Raghav T
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Raghav,

Yes it is possible to import using dataloader. Please find the below article (https://help.salesforce.com/s/articleView?id=000385818&type=1) for the same.


1) Create a .csv file with the following column headers:
Parent ID
From Address
From Name
To Address
CC Address
BCC Address
Is Incoming
Message Date
Status
Headers
Subject
Text Body
HTML Body
 
Note: It is best to compare the column headers mentioned above with the fields in email records you currently have in Salesforce. By doing so, you will know what type of data (value) goes into the Salesforce fields. See also: EmailMessage | SOAP API Developer Guide 
 
2) Start the Data Loader and use the "Insert" function.
Log in with your credentials. Note that you may have to use a security token for this. Click Next after authentication.
3) Select the Show all Salesforce Objects box and select the object: Email Message (EmailMessage).
Choose the .csv file (the one from step 1) and click Next.
4) Click OK on the confirmation window indicating the number of records to be processed.
5) On the next page, click Create or Edit a Map.
6) On the Mapping screen, click Auto-Match Fields to Columns and click OK.
7) Click Next.
Choose the destination for the error and success files then click Finish.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,