Skip to main content

Hi Salesforce Fam, 

 

For the Contacts upload, is there a way to perform duplicate checking using a script in Data Inspector before loading the records 

 

Currently, bulk uploads appear to bypass the existing business rules and create new Contact records. 

 

Is there a way, I would be able to run a query to identify potential duplicate Contacts before the upload. The main duplicate check would be based on email, and potentially First Name + Last Name where Email is blank.

6 réponses
  1. 16 sept., 16:09

    Hi Madhu, 

     

    One thing worth adding to what's already been said: the Duplicate Rule's "Block" action does actually enforce on API/Bulk/Data Loader inserts — it makes the save fail outright, since that's a real DML rejection, not just a UI popup. What doesn't work outside the UI is "Allow" with an alert — that's just a modal, and Data Loader/Bulk API/REST never render it, so records slide through as if no rule exists at all. 

     

    So check Setup → Duplicate Rules → your Contact matching rule → Action on Create. If it's set to Allow/Report instead of Block, that's exactly why bulk uploads keep creating duplicates while everything looks fine elsewhere. The rule is firing, there's just nothing to show the alert on, so it lets the record through silently. 

     

    For the pre-upload check itself, the earlier suggestions are solid — Data Inspector can only query what's already in the org, not diff against your CSV, so: 

    - Existing dupes in org: the GROUP BY Email / FirstName+LastName queries already shared work fine 

    - Incoming file vs org: export existing Email (and Name where Email is blank) and compare in Excel, or mark Email as an External ID and use Upsert instead of Insert so Salesforce matches automatically on every future load 

     

    https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api/headers_duplicaterules.htm

0/9000