Loading

Mass relate Contacts to multiple Accounts with Data Loader

Date de publication: May 24, 2026
Description

Salesforce allows administrators to associate Contacts with Multiple Accounts using the Contacts to Multiple Accounts feature. After an administrator has Set Up Contacts to Multiple Accounts, it is possible to add new contact and account relationships in bulk using Data Loader.

Résolution
Important: Always back up your data before performing any data operation. See Export Backup Data from Salesforce  or Export Data for details. It is recommended to run a test with a small subset of records to verify results before running the full operation.

Step 1: Prepare Your CSV File

Create a CSV file with the following columns:
  • Contact Id — IDs of the contacts you want to associate with multiple accounts.
  • Account Id — IDs of the accounts to associate with each contact. Each contact-account relationship must be on a separate row. For example, if you are associating 1 contact with 5 accounts, your CSV should have 5 rows with the same Contact Id.
  • Roles (Optional) — Available values can be found in Setup by entering Contact Roles on Accounts in the Quick Find box and selecting Contact Roles on Accounts. Separate multiple values with a semicolon (e.g., "Business User;Decision Maker;Technical Buyer"). See  Update multi-picklist field values using Data Loader for details.
  • IsActive (Optional) — Indicates whether the relationship is active (true) or inactive (false).
  • Start Date (Optional) — The date a relationship between a contact and account began. Format: YYYY-MM-DD (e.g., "2017-12-01").
  • End Date (Optional) — The date a relationship between a contact and account ended. Format: YYYY-MM-DD.
Note: You may need to manually set the date column format in Excel before saving. See  Why do date fields import incorrectly when I use the Data Loader? for guidance.

Step 2: Populate the CSV with Record IDs

Populate the file with your desired contact and account record IDs, along with any optional columns, and save.
An example CSV file ("AccountContactRelation Example.csv") is attached to this article. The example shows 1 contact being associated with 3 different accounts for illustration purposes.
You can find existing Account and Contact record IDs by viewing records in Salesforce as described in Unique Record IDs in Salesforce. Alternatively,  Build a Report and Export a Report it in CSV format, or use Data Loader to Export Data including Account and Contact IDs.

Step 3: Run the Data Loader Insert Operation

  1. Open Data Loader and select Insert | Login | Next.
  2. Click Show all Salesforce objects to locate and select Account Contact Relationship (AccountContactRelation). Click Browse and choose your CSV file, then click Open | Next.
  3. Verify the record count is correct and click OK. Click Create or Edit a Map, then Auto-Match Fields to Columns. Verify the field mappings are correct and click OK | Next.
  4. Click Browse and select a location on your local machine for the success and error files. Click Finish | Yes.
Numéro d’article de la base de connaissances

000382467

Pièces jointes

AccountContactRelation Example.csv

0 KB

 
Chargement
Salesforce Help | Article