The Salesforce CRM platform allows businesses to manage their sales, customer interactions, and marketing operations.
One key feature in this CRM that enhances collaboration within Salesforce is the Opportunity Contact Roles, which associates specific contacts with opportunities, providing information on the relationships involved in closing a deal.
In this Salesforce tutorial, we will learn about importing Opportunity Contact Roles using Data Loader in Salesforce.
Data Loader to Import Opportunity Contact Roles (OCR)
In Salesforce, we have a robust data management tool called Data Loader, which is used to perform data operations like import, update, delete, upsert, and export. Importing Opportunity Contact Roles (OCRs) helps in efficiently managing your Salesforce opportunities and Contacts data.
Salesforce Data Loader simplifies data import and export tasks and has the capability of handling OCR data with data accuracy.
Import Opportunity Contact Roles with Data Loader in Salesforce
To import opportunity contact roles with the data loader in Salesforce, ensure that you have installed the Data loader tool in your system and have required access to update opportunity data.
Now follow the below steps, if you meet the above requirements.
1. First, we will create a CSV file with the following header columns.
- ContactID – ID of the contact you are adding to the Opportunity Contact Roles related list.
- OpportunityID – ID of the opportunity you are adding the contact to.
- Role – Name of the role you are assigning to the contact. This needs to be a value from the Role picklist of your org.
- IsPrimary – This will mark the primary checkbox on the Contact role.

2. To get the IDs of the Contacts, it will be better to run an export of the contacts object via data loader by following the steps.
- Open the data loader and click Export
- Select the data object Contacts and click Next
- Select the query field ID, and for reference, select Name.
- Click Finish
3. To get the Opportunity ID, open the Salesforce console and go to the opportunity record in which you want to import the contact role. Then, from the URL, get the 15-digit code starting from 00.

If you are importing contact roles for mass opportunities, then you can export opportunity objects from the data loader with field ID and other fields for reference.
4. Now, enter the ContactID and OpportunityID in the CSV file. After this, enter the IsPrimary column value as True if you want to make the contact role primary. Here, you can make only one contact as primary.
Then, enter the name of the role in the Role column.

If you don’t have any idea about the org’s role names, then go to Setup -> Quick Find box -> search Roles -> select Contact Roles on Opportunites, and get the role name from the Opportunity contact role window.
5. Now open the data loader, log in with your credentials, and click on the Insert button.

6. In this step, activate the checkbox Show all Salesforce objects, then select the data object Opportunity Contact Role. After this, select the CSV field that we have created in the above steps, then click on the Next button.

7. Now, the data loader will initialize the uploaded CSV file and display the number of rows in the CSV file. Here, click on the OK button.

8. In this step, we will map the object fields with columns of CSV file, and for that, click on the button Create or Edit a Map. In the next window, click on the button Auto-Match Fields to Columns.
Now the field names will be auto-matched to the header columns, if not then you have to drag the object fields down to the column mapping.
After mapping, click on the OK button, then click on the Next button.

9. In this step, select the location for the Errors and Success files from where they can be accessed later, and then click on the Finish button.

10. As we click on the Finish button, a warning message will appear on the screen regarding the data insert operation. Here, click on the OK button to proceed.

11. Now, the data import will start, and after the completion of data insertion, we will see a dialog box displaying the number of errors and successes that occurred during the data import operation.
At last, click on the OK button to close the data loader.

In this example, we got the success in data import with zero error, which means the data import was successful.
12. Now, to view the imported contact roles, open the opportunity record whose ID you have used in the import, then go to the section Contact Roles, and there you will see the imported contacts.

In this way, we can import opportunity contact roles with the data loader in Salesforce by following the above steps.
Conclusion
With this, you have learned successfully how you can use the data loader in Salesforce and import opportunity contact roles in bulk effectively and easily.
You may like to read:
- How to Update Picklist (multi-select) Values in Salesforce with Data Loader
- How to Mass update record types with Data Loader in Salesforce
- How to Add Contacts to Campaign in Salesforce
- Set Up Contacts to Multiple Accounts in Salesforce
- How to Insert or Update Price Books with Data Loader in Salesforce
- Manage Territories and Territory Models for Opportunities in Salesforce
- How to Make a Contact Primary in Salesforce Opportunities
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.