How to Find and Merge Duplicate Records in Salesforce

A full workflow for cleaning up duplicate accounts, contacts, and leads in Salesforce - the native merge tool, its record limits, and the SOQL to find what it can't show you.

Updated 2026-09-09

Merging is the second half of deduplication - finding the duplicates is a query, merging them is a decision about which record wins. Salesforce's native merge tool handles the mechanics; the judgment about which record to keep is still yours.

This covers the native merge flow, its limits, and how to build the worklist it does not generate for you.

Step 1 - build the worklist with SOQL

The native merge screen needs you to already know which records collide. GROUP BY ... HAVING COUNT(Id) > 1 produces that list from the actual data rather than from Salesforce's duplicate rules, which only catch new records going forward.

Duplicate account names
SELECT Name, COUNT(Id) total
FROM Account
GROUP BY Name
HAVING COUNT(Id) > 1
ORDER BY COUNT(Id) DESC

Step 2 - the native merge flow

  • Accounts, contacts, and leads each have their own merge screen, reached from the record's detail page (Accounts and Contacts) or from a list view (Leads, which supports merging up to 3 at once).
  • You pick a master record and, field by field, which value survives where the records disagree.
  • Related records - opportunities, cases, activities - are reparented to the surviving record automatically.
  • The merge is permanent. There is no unmerge; the losing record's ID redirects to the winner's, which is why an export beforehand matters.

Step 3 - what the native tool cannot do

  • Accounts and contacts merge two or three at a time; a worklist of 200 duplicate names means 200 manual merges unless you script it via the API.
  • There is no native bulk-merge UI - large-scale deduplication projects use the Bulk API or a dedicated data-quality tool instead.
  • Custom objects have no merge screen at all. Deduplicating a custom object means exporting, deciding a winner, reparenting children by hand, and deleting the loser.

Prevent the next batch

Merging without fixing intake means doing this again next quarter. Salesforce's duplicate and matching rules catch new duplicates at save time with fuzzy matching - exact-match SOQL and native merge only clean up what already got in.

Frequently asked questions

Can I undo a Salesforce record merge?
No. The merge is permanent - the losing record's ID becomes an alias that redirects to the surviving record. Export the pre-merge values first if you need a record of what was lost.
How many records can I merge at once?
Accounts and contacts merge two at a time from the detail page. Leads merge up to three at once from a list view. There is no native bulk-merge screen for any object.
Does merging fire automation?
Yes - triggers, flows, and workflow rules on the affected objects and on any related records that get reparented can fire during a merge, the same as any other DML operation.

More from the Admin How-To

Related reading