I have a CSV file that contains First, Last, and Email.

I want to add these emails to a campaign, but not as leads, as it would create a large number of duplication.

I know how to add contacts to a campaign if I have their ContactID, so how can I get Salesforce to convert the CSV emails into ContactIDs?

  • Well, I've found something that seems to be working but it's a major hack. Using the Data Loader I downloaded ALL contacts from Salesforce, and then used Excel and LOOKUP after sorting the contacts by email address. Specifically, things like =LOOKUP(D141,contacts.csv!D:D,contacts.csv!A:A)
    – bombcar
    Jul 24, 2014 at 18:14

2 Answers 2


Well, this worked, but I am kind of amazed you have to do it this way.

First, I used the Data Loader to download all contacts as a CSV file.

I then opened the file in Excel, and added the XLS of names emails as a second sheet which I called "campaign".

Then I re-arranged the contact list to have the email address first, and the contact ID second. Then I sorted the contact list by email address.

Moving to the SC sheet, I added a column “ContactID” and put this formula in the first cell:


Then I copied that formula to every row. I then sorted the "campaign" sheet by the ContactID field, and copied the valid ContactID rows to a third sheet called “addtocampaign.csv” and copied the #N/A names, companies, and emails into a sheet called “campaignleads”. I exported both those sheets as CSVs. I imported the first into the campaign as “Contacts” and the second as “Leads” and it worked!


You're gonna need to store them in salesforce, as contact or as lead.

Personally I'd try to insert or upsert them into the lead object. This has the benefit that you can deduplicate, and prevent targeting leads or contacts twice. This type of functionality is pretty much why you have the lead object in my opinion.

You can't really "convert to contactId", you can insert as contacts, and attempt to query the ID's back. Either based on the email, which may also result in duplicates. Or by inserting some unique value on which you can than query them out again. Basicly you would insert with some value on which you can then segment/find them so that you can add them as campaign members.

  • The users already exist in Salesforce as contacts. I tried importing one as a lead, and it created a lead with the same name and email as an existing contact - is there a way to "mass merge" leads into existing contacts without overwriting information or having to do each one by hand? I suppose if I could find a way of updating the contacts so they were a member of the campaign, that would also work. Something like Email CampaignID test@ 00xU000000yhSas that would then figure out which contact I meant by the email.
    – bombcar
    Jul 24, 2014 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .