I'm looking to import a large list of leads but I'm hesitant to due to the fact that some of these leads I'd be importing could very well already be marked as Contacts in the CRM. Is there a way to avoid duplicates based on email address for leads? Thanks.
I can think of four options off the top of my head, there may be more
(a) Write a after insert trigger on Lead that checks for duplicate email versus Contacts and then deletes the Lead (or (b) a before insert trigger that does addError() - depending on your upload tool (Data Loader, Import Wizard - partial successes will be honored)
Export all your Contacts into Excel and do a VLOOKUP of the lead email versus the Contact emails; any matches - delete the rows from Excel before you upload
Look into one of the appexchange Lead and Contact data Quality packages like RingLead
Import all the Leads and then use an anonymous Apex script to run through them, looking for matches against Contacts - then delete all the matches. This may take several passes if the number of Leads is large due to governor limits. If the Leads are imported using a known userId, then finding the ones you imported is straightforward (via
createdDate). This has one advantage over #1 in that you don't have to develop-deploy anything. The disadvantage is you have to know what you are doing to avoid inadvertent database updates. Best not used on orgs that have rigid SDSLC processes.
Be cognizant if you have any automatic workflows/processes/email alerts that you might want to turn off if using approach #1a or #4