0

I am trying to insert data into a custom object. My MD field with Contacts is Email__c. I want to use the email to identify the contact as is the unique identifier for my custom object. ( like when you insert in dataloader.io and for the contact id you select look via email).

Is it possible to do that on apex data loader? Whenever I try I get an error like Contact: id value of incorrect type: xxxxxx@xxx.com

I have 100k records to insert into 60k Contacts. Replacing their email with SF contact's id will take alot of time

1
  • 1
    An export and a vlookup on email doesn't take that long to build a file (I've done it with millions of records), and it's the only way I'm aware of to accomplish what you are attempting. Unless you make a field an ExternalID value, you have to use ID.
    – HomerJ
    Apr 21 '15 at 13:11
2

You can do that - but the external Id field needs to be on the Contact which you then reference in the data load. You can't use the standard email field for that though - so you would need to create a new field on Contact called something like Email_Reference, mark it as an external id, and then populate it with the email on the contact - probably via workflow or a trigger. Then when you load in your data via the dataloader, you can select upsert, choose email_reference as the lookup reference, and map your email field in your data to that reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.