# Salesforce import duplicate cleanup with DataGroomr: find, explain and merge duplicates before the campaign goes out

Source: https://mcpforgtm.com/recipes/datagroomr-import-duplicate-cleanup (StackMCP, independent directory of official MCP servers)

## Goal

Marketing ops and RevOps people who just loaded a list into Salesforce and need to clean it before the first email goes out. You get a health summary for the dataset, the duplicate groups the import created, where they came from, and a proposed record to keep for each group. Merges happen one group at a time, only after you approve. On HubSpot, the CRM hygiene sweep recipe flags duplicates for reps instead.

## Connected tools

- DataGroomr: https://mcp.datagroomr.com/mcp (setup: https://mcpforgtm.com/tools/datagroomr)

## Guardrails

- Read only until I approve. Don't analyze a dataset, merge or undo anything without my approval.
- Merge one group at a time. Show me the records, the match reason and the record you'll keep before I approve each one.
- Never run mass actions, workflows or schedules, and never change datasets, matching models or rules.
- Don't verify or enrich records. Those spend credits.
- Record results include real field values and email addresses. Don't copy them anywhere outside this chat.

## Steps

1. In DataGroomr, show me the data health summary for my {object} dataset {dataset_name}, and when it was last analyzed. If that was before {import_date}, tell me, and only after I approve, analyze the dataset again. Don't change anything else.
2. List the duplicate groups that include a record created on or after {import_date}. Show the group size, the match explanation and the record names. Sort by group size and show the total count.
3. For those groups, trace where the duplicates came from (an import, a web form, a user or an integration). Group the results by source, and tell me how many came from {import_name}.
4. For each group, propose the record to keep (prefer one with an owner, open opportunities or activity) and flag any group that may be two different people. Show it as a table. Only after I approve a group, merge it, one group at a time.
5. Show me the merge history for today's merges and list any that failed. If I ask to undo a merge, show me what will change and only undo it after I approve.

## Expected output

Leads dataset after the Nov 20 webinar import (fictional org). Example (all names fictional):

```
Dataset: Leads, all US. Data health: 87% of records have an email, 64% have a phone.

Duplicate groups that include a record created since Nov 20: 23 groups, 51 records.

| Group | Records | Match reason | Source |
|---|---|---|---|
| Dana Okafor, Larkspur Freightworks (fictional) | 3 | Same email, same company | 2 from the webinar import, 1 from a web form |
| Sam Whitlock, Mossgate Labs (fictional) | 2 | Same name, email differs (sam@mossgate.example vs s.whitlock@mossgate.example) | Import and a rep's manual entry |
| Jordan, Quarry Lane Analytics (fictional) | 2 | Same phone, different last names | Import |

By source: 17 of 23 groups came from the webinar import file.

Proposed keep record: the oldest record with an owner and activity. Groups 1 and 2 look safe. Group 3 may be two different people sharing a front-desk phone. Don't merge it.

Waiting for approval: merge group 1, keeping the Oct 2 web form record. Nothing has been merged yet.
```

## Watch for

- Duplicate results older than the import: Ask when the dataset was last analyzed. If that was before the import, the new records may not be in any group yet. Run the analysis after you approve it, then list the groups again.
- Two different people treated as one: Groups matched only on phone, company or a common name are often different people at the same company. Open the match explanation, and skip any group where the emails and titles both differ.
- Keeping the wrong record: The newest record from an import usually has no owner or activity. Prefer the record with an owner, open opportunities or logged activity, and say which fields to carry over before you approve.
- A bad merge you can't take back: Its listing calls merges irreversible, even though there's an undo tool. Treat every merge as permanent: approve one group at a time, and check the merge history after each batch.
