Loading

Import Email Messages in bulk and relate them to Cases

게시 일자: Jun 17, 2026
상세 설명

Salesforce Data Loader can be used to bulk import email records and associate them with the Email section of the Activity History on Cases. This is useful when you need to migrate historical email communications into Salesforce and relate them to existing Case records for a complete activity timeline.

When to use this approach:

  • When migrating a large volume of email records from an external system into Salesforce Cases.
  • When Email-to-Case is already enabled in your org and you need to backfill historical emails.
  • When you need email records to appear in the Case's Activity History under the "Emails" section.

Requirements:

  • Access to the Salesforce API (not available in all editions).
  • Email-to-Case must be enabled in the org.
솔루션

Steps to bulk import email messages and relate them to Salesforce Cases using Data Loader:

Step 1 — Prepare the CSV import file

Create a .csv file with the following column headers. Each column maps to a field on the Salesforce EmailMessage object:

  • ParentId — The Salesforce Case ID (15 or 18-character) to relate the email to
  • FromAddress — The sender's email address
  • FromName — The sender's display name
  • ToAddress — The recipient's email address
  • CcAddress — CC email addresses
  • BccAddress — BCC email addresses
  • IsIncoming — True if the email was received; False if it was sent
  • MessageDate — The date and time the email was sent or received
  • Status — The email status (e.g., New, Read, Replied)
  • Headers — Email header data (optional)
  • Subject — The email subject line
  • TextBody — Plain text version of the email body
  • HtmlBody — HTML version of the email body

Best practice: Compare these column headers with the fields on existing EmailMessage records in your Salesforce org to understand the expected data types and formats. See: EmailMessage | SOAP API Developer Guide 

Step 2 — Import using Data Loader

  1. Launch Data Loader and select the Insert operation.
  2. Log in with your Salesforce credentials. A security token may be required. Click Next after authentication.
  3. Check the Show all Salesforce Objects box and select the object: Email Message (EmailMessage).
  4. Choose the .csv file prepared in Step 1 and click Next.
  5. Click OK on the confirmation window showing the number of records to be processed.
  6. Click Create or Edit a Map on the next page.
  7. On the Mapping screen, click Auto-Match Fields to Columns and click OK.
  8. Click Next.
  9. Choose the destination for the error and success log files, then click Finish.

Important notes:

  • If ParentId (Related To field) is not provided while inserting EmailMessage records, the emails become private to the user who imported them and will not appear in Case Activity History.
  • Inserting Audit fields together with records that have no Parent ID causes an "insufficient access rights on cross reference ID" error.
  • To display the attachment or paperclip icon in Activity Timeline for an email that has linked content, add and set the IsClientManaged field to True in your .csv file for the Insert operation.
  • To import emails into the Activity History of other Salesforce objects (not just Cases), see: Import Tasks or Events into existing records. 
Knowledge 기사 번호

000385818

 
로드 중
Salesforce Help | Article