How to Merge Duplicate Salesforce Contacts, Accounts, Leads, Opportunities, and Other Record Types
Insycle's Merge Duplicates module identifies and combines redundant contacts, accounts, leads, opportunities, and custom record types in Salesforce. This article explains all available options, rules, and settings—covering matching logic, master record selection, field retention, automation, and Salesforce-specific behaviors. Use it as a reference when working in the module or to understand how various settings affect your merge results.
Insycle uses Salesforce's underlying APEX and CRUD APIs, which require the installation of Insycle's Salesforce AppExchange app.
Supported Salesforce Record Types
Insycle supports the following Salesforce record types by default:
- Contacts
- Accounts
- Leads
- Opportunities
You can request enabling custom or other standard record types for your account by contacting our support team.
All enabled record types will appear in the dropdown at the top of the module.
Salesforce Merge Logic Explained
How Data Is Consolidated When Bulk Merging
The following describes how data is consolidated using the default merge method for each Salesforce object type:
Contacts, Leads, and Accounts
Insycle uses Salesforce's Native merge using the APEX API when merging contacts, leads, and accounts. For more information, see Salesforce's Apex Developer Guide.
If you want to merge contacts, leads, and accounts using the Synthetic method, contact our support team to enable this option. Keep in mind that using Synthetic merge on leads, contacts, and accounts is slower and offers limited control over deeply nested relationships.
Opportunities and Other Standard or Custom Objects
When merging opportunities and any other standard or custom object, Insycle performs a Synthetic merge that uses the Salesforce CRUD API to merge and re-parent related objects from the duplicate records into the master.
- Record ID: The Record ID from the master record is kept.
-
Fields:
- To customize how field data is retained in the master record on a field-by-field basis, use the Field tab under Step 3.
- By default, the value is retained from the master. When a value is empty in the master, it picks a non-empty value from the most recently updated duplicate. All other values are available in the audit trail.
- Multi-select picklist fields: All selected values from duplicate records and the master are automatically consolidated into the master record. For example, if the master record has the value "Newsletter" and a duplicate has the value "Product Updates," the merged record will contain both "Newsletter" and "Product Updates."
- To disable the automatic fill-in-the-blanks feature, toggle off the Blank Fields option on the Method tab of Step 3.
- Relationships: Insycle inspects the schema metadata for relationships to duplicate records and relinks those relationships to point to the master record instead of the duplicate. For example, that's how it would re-link "Notes" in the duplicate records into the master record.
While synthetic merge can streamline the process, because of its complexity, it is best practice to first test your merge operation with one or two records and verify that the results in Salesforce are as expected.
Deduplication Process
When merging duplicates, Insycle goes through the following steps for all Salesforce record types:
- Select the master record according to the rules set in Step 3 on the Master tab.
- Determine field values to retain in the master record based on rules configured in Step 3 on the Fields tab.
- For fields without specific rules, identify non-empty values using a "fill in the blanks" method:
- Check whether the master record has any empty fields.
- If empty, copy values from the most recently updated record in the duplicate group.
- Update the master record by:
- Applying the field values chosen in step 2 (from Field rules).
- Adding the non-empty values identified in step 3 using the "fill in the blanks" approach (unless this is disabled on the Method tab).
- Preserving all other existing values in the master record.
- Merge the duplicate records and reassign all related objects to the master record.
- Store an audit trail report accessible from the Activity Tracker and send an email notification to the designated recipients.
Merging Contacts Related to Multiple Accounts
If you have enabled Salesforce's setting to allow a contact to be related to multiple accounts, Insycle's Merge Duplicates module ensures that all account relationships are preserved during the merge process. It automatically reassigns both primary (direct) and secondary (indirect) account links to the master record while removing any redundant relationships. This provides a comprehensive view of the contact's interactions across all linked accounts within your business.
Insycle intelligently handles scenarios where duplicate contacts are linked to the same secondary accounts. It identifies overlapping relationships and automatically removes extraneous links from the records being merged, while retaining them on the master record. This prevents the common Salesforce error:
"Can't merge contacts. These contacts have the same related account. Remove the redundant account-contact relationships and then try merging again."
By addressing these relationship-mapping challenges, Insycle streamlines the deduplication process, saves significant time and effort, and ensures valuable account-contact relationship data is not lost when merging duplicates with multiple links.
Learn more about deduplicating with Salesforce’s feature for linking contacts to multiple accounts.
Merging Accounts Related to Multiple Contacts
When duplicate Salesforce accounts share indirect relationships with the same contacts, Insycle's Merge Duplicates module preserves all contact connections while automatically removing redundant relationships. This ensures that the merged account maintains a complete view of all associated contacts without triggering Salesforce's merge restrictions.
Insycle intelligently identifies when duplicate accounts are both indirectly related to the same contact through the Related Contacts list. During the merge process, it consolidates overlapping indirect relationships into the master account while removing duplicate connections from the records being merged. This prevents the Salesforce error:
"Can't merge accounts. These accounts have the same related contact. Remove the redundant account-contact relationships and then try merging again."
By automatically handling these complex relationship scenarios, Insycle eliminates the manual work of identifying and removing redundant contact relationships before merging accounts. This streamlines your deduplication workflow and ensures that valuable account-contact relationship data remains intact throughout the merge process.
Review Salesforce's Guidelines for Merging Duplicate Accounts.
Fill-in-the-Blanks Data Retention
Though you can create custom data retention rules for any fields using the Fields tab under Step 3, it is not required. There is no need to create rules for every field in your Salesforce data - Insycle automatically handles fields without specific rules with a "fill in the blanks" approach.
When the master record has empty fields, Insycle copies values from the most recently updated record in the duplicate group where that data exists. For example, if the master record's Industry field is empty but another record in the duplicate group has an Industry value, that value will automatically be copied to the master record.
This means you only need to create custom retention rules for the fields that require special handling, rather than setting up rules for all your fields. Learn more in the Keeping the Right Data When Records Merge article.
Step-by-Step Process Overview
The Merge Duplicates module follows a four-step process:
Step 1: Find Duplicates
Step 1 is where you define which fields Insycle should examine to find duplicate records, and set the rules for how those fields are compared. Each field you add is cumulative — records must match all of the criteria you specify to be flagged as potential duplicates. For example, matching on First Name AND Last Name AND Email Domain returns only results where all three values are the same.
Step 1 operates through three tabs:
- The Simple tab is where you add matching fields and configure comparison rules, ignored elements, match parts, and conditions.
- The Advanced tab is where you configure Related Fields for any field already added on the Simple tab.
- The Conditions tab is where you set conditions for any field already added on the Simple tab.
A field must be added on the Simple tab before it can be configured on the Advanced or Conditions tabs.
See Setting the Criteria for Finding Duplicate Matches for a complete breakdown of options.
Additionally, Step 1 includes a CSV tab that lets you upload a file of known duplicate record ID pairs directly — bypassing field-based matching entirely. See Merging Duplicates from a List You Already Have for details.
Step 2: Review Duplicates
Step 2 displays all duplicate groups identified in Step 1, allowing you to review and verify the matches before proceeding. Records that match your Step 1 criteria are automatically clustered into duplicate groups — each group represents a single entity and shows how many duplicate records it contains. For example, three records for the same person would appear as a single duplicate group containing three records.
Click the chevron at the right end of a duplicate group row to expand it and examine the individual records within that group. You can also add fields as columns to provide more context when evaluating the matches by clicking the gear icon.
To exclude a duplicate group from all future deduplication analysis, click the X on the group row. Excluded groups will not appear as duplicates or be included in merges, even when using different duplicate detection templates. To review and manage excluded groups, click the Exclusions button in the Step 2 header.
Step 3: Merge Logic
Step 3 is where you configure how duplicate groups are consolidated—from choosing your operation mode to defining master selection rules and field retention logic. This step combines operation selection with the merge logic configuration through multiple tabs.
At the top of Step 3, choose between Bulk and Manual modes in the header:
- Bulk mode (recommended) automatically merges all duplicate groups according to the master record selection rules you define in the Master tab. This is the right choice for most deduplication processes, and the only mode that supports templates, Recipes, and automation.
- Manual mode lets you review and select specific records to merge individually from the Record Viewer. Reserve this for high-value records or complex scenarios where you want hands-on control over each merge. Learn more about merging duplicates using Manual mode.
Step 3 operates through three tabs that work together:
1) Master tab
The Master tab is where you set the rules that determine which record in each duplicate group becomes the master. Insycle evaluates your rules in order from top to bottom, and the first record that uniquely matches a rule becomes the master. If no record matches any rule, master selection fails for that group. See Choosing Which Records to Merge Using a CSV for a full breakdown of all rules and options.
At the bottom of the Master tab, you'll also configure:
- Processing method — Choose between By Priority (evaluates rules in sequence, stops at first unique match) or Absolute (master must match all rules). Most operations should use By Priority.
- Exclusions — By default, Insycle skips any duplicate group containing more than 5 records—this prevents overly broad matching criteria from accidentally merging unrelated records. You can adjust this threshold up to 100 records per group.
2) Fields tab
The Fields tab is where you control which field values end up in the master record after the merge. By default, Insycle keeps the master record's values and fills any empty fields with values from the most recently updated duplicate. You can override this on a field-by-field basis for any fields that need special handling. See Keeping the Right Data When Records Merge for all available criteria and conditions.
3) Method tab
The Method tab lets you choose between Native and Synthetic merge logic, and control whether empty master fields are automatically filled. See Native vs. Custom Merge: Two Ways to Combine Records in HubSpot and Salesforce for details.
Step 4: Review
Step 4 is where you preview and apply your merge changes. It operates in two modes:
- Preview Mode generates a CSV report that shows exactly how your records would be merged based on your current configuration — which records become masters, which field values end up where, and whether any errors occur. No changes are made to your CRM. Always run Preview Mode before Update Mode to verify everything is working as expected.
- Update Mode applies the merge to your live CRM. Once you've confirmed your Preview results look correct, Update Mode executes the actual merge operations.
If you are merging opportunities or custom objects, the Merge API is set to Synthetic on the Module tab in Step 3. Running in Update Mode displays a Please confirm dialog before the operation begins. Synthetic merges can take longer to process than Native merges used on contacts, leads, or accounts. This dialog shows an estimated time for the merge based on the number of associations and engagements that need to be reassigned. Click Yes to proceed.
The CSV report includes records from all duplicate groups. It shows the current state of the master record, excluding reassignments of linked contacts, deals, or activities. (To validate how the relinking will occur, run a small-scale test in Update mode.) This ensures that the CSV accurately reflects the merge setup before execution in Update mode.
The Duplicate Group ID indicates which records will be merged together.
The Status column indicates:
- Duplicate – The record is part of a duplicate group.
- Master – The master record is chosen for the duplicate group based on default behavior and your Master rules. Review the selections in this row to determine whether the appropriate records are being chosen.
- Master (After) – For each duplicate group, a Master (After) row shows the values the final record will contain based on your Field rules and the default behavior.
- Error – If Insycle cannot determine which record is the master, an error message will appear here. See the Merge Duplicates Troubleshooting article for next steps.
Save a Template and Set Up Automation
After you've seen the results in Salesforce and are satisfied with how the operation runs, you can save your configuration as a template and set up automation so this merge operation runs on a set schedule. Then, you can bundle templates into Recipes and integrate them into Salesforce flows.
Return to the Template menu at the top of the page and click copy to save your configurations as a new version of the template you started with. Then, click the pencil to edit your new template name.
Under Step 4, click the Review button and select Update mode.
On the Notify tab, select the send option appropriate for your automation: Always send, Send when errors, or Do not email.
Add any additional recipients who should receive the CSV (hitting Enter after each address) and provide context in the message subject or body.
On the When tab, select Automate and configure the frequency you'd like the template to run. When finished, click Schedule.
You can view all your scheduled automations at any time on the Operations > Automations page.
Learn More:
Create a Recipe and Integrate with Salesforce Flows
When you have a solid set of templates that reliably merge your records, you can put them together into a longer, ordered sequence as a Recipe. Then, you can schedule that Recipe to run on a consistent, set schedule. Your templates will run one after another in the order that you set.
To add your Recipe to a Salesforce Flow, the Automate setting must be Salesforce Flow Integration.
Learn more about integrating Insycle Recipes with Salesforce flows.
Advanced Techniques
Merge Duplicate People Across Leads and Contacts
If you're experiencing issues because the same person appears in Salesforce as both a lead and a contact, you can use the Merge Duplicates module to deduplicate leads and contacts together.
Open the Merge Duplicates module and pick the Contacts record type.
Then, under Step 1, check the Include Leads checkbox.
Learn more about merging duplicate individuals looking at both leads and contacts.
Deduplicate Records That Sync Between Salesforce and HubSpot
Salesforce doesn't have a native field indicating whether a record is actively synchronizing with HubSpot — that information lives on the HubSpot side in the Salesforce object ID property. This lack of visibility from the Salesforce side can make it difficult to guarantee that the synced record becomes the master when deduplicating.
There are two ways to create that visibility:
- Use the Deduplication Master Record field approach — A custom checkbox field is created in both CRMs and synchronized one-way from Salesforce to HubSpot. After Insycle runs the Salesforce merge and stamps the master, that value propagates to HubSpot and is used to align master selection in the HubSpot merge. This is the recommended approach for most teams.
- Create a custom Salesforce field that HubSpot writes its record ID into — In Salesforce, create a custom number field (18 digits) on each object type you plan to deduplicate. Then, in HubSpot's Salesforce integration property mappings, map the HubSpot record ID to that custom Salesforce field with the sync rule set to Two-way. Because the HubSpot record ID is system-generated and not editable, Salesforce cannot overwrite it — so two-way sync behaves safely here. After the sync runs, that Salesforce field will be populated on any record with a linked HubSpot counterpart and left empty on records without one. You can then use that field in Insycle's Master Selection rules — records where this field is populated should be preferred as master.
In both cases, setting HubSpot's deletion behavior to "Do nothing" first is still required as a safety net, regardless of which approach you use. See the Deduplicate Salesforce and HubSpot While Keeping the Sync Active article for details.
The image above shows the Deleting Contacts section of the Salesforce app integration's Object Data Sync settings in HubSpot. This section controls what happens in one system when a contact is deleted in the other. The settings are configured directionally: when a Salesforce contact is deleted, HubSpot is set to Do nothing; when a Salesforce lead is deleted, HubSpot is set to Do nothing as well. The reverse direction — when a HubSpot contact is deleted — is fixed at Do nothing in Salesforce and cannot be changed.
Deduplicate Salesforce Accounts and Corresponding HubSpot Companies While Sync is Active
Deduplicating Salesforce accounts that are synchronized with HubSpot companies requires coordinating merges across both platforms. You need to determine the appropriate “master record” to use across both CRMs and consider the merging process.
When the HubSpot–Salesforce integration is active, HubSpot automatically creates and populates a Salesforce Account ID property on any company record that is synchronized with a Salesforce account. This makes it straightforward to identify the correct master record on the HubSpot side without any custom field setup.
When you deduplicate accounts in Salesforce, you then need to clean up the corresponding duplicate companies in HubSpot.
To address this using Insycle's Merge Duplicates module, the recommended process is:
- Deduplicate Salesforce accounts first.
- Then, deduplicate HubSpot companies, using Salesforce Account ID exists as the first Master Selection rule to identify the synchronized record as master.
For the full steps, refer to the Deduplicate HubSpot Companies and Salesforce Accounts article.
Granular control for picking duplicate records
For situations where there are no common rules you can apply for identifying duplicates for all or some of your records, you may need more granular control over which records are included or excluded from the process.
Bulk Solutions
There are two options for doing this in bulk. You can upload a CSV file of known duplicate record ID pairs directly into the Merge Duplicates module using the CSV tab in Step 1. This lets you bypass field-based duplicate detection entirely and work from a list of specific record pairs you've already identified. From there, you continue through Steps 2–4 to configure master selection rules and field retention settings, and then run the merge.
For more complex scenarios — such as designating master records or excluding specific records from deduplication using custom attributes — you can also use the Magical Import module in combination with Merge Duplicates for complete control over the process.
Learn how to customize merging duplicates in bulk using a CSV.
Single Record Solution
To do this one record at a time, you can use Manual mode of the Merge Duplicates module.
In Manual mode, you have complete control over which records are merged together by selecting them from the Record Viewer. Manual mode should be reserved for cases that require a careful, controlled process. Learn more about merging duplicates in Manual mode.
Explore additional deduplication techniques in our Common Scenarios articles.
Tips for Backing Up Data Before Merging
Backing Up Fields from Insycle
When setting up your merge operation in the Merge Duplicates module, add extra fields to be included in the CSV report so you have the data later for undoing changes and/or just for general review.
Under Step 2, click the gear icon in the header.
On the Layout tab, add any extra fields to the Visible Fields list.
The fields will be included in the CSV report.
Backing Up Records from Salesforce
Before running a large merge operation, you can export all records directly from Salesforce to a CSV file. This can preserve all the record details, which can help later for undo and/or just for general review.
Create a Targeted Salesforce Report
To select only the necessary fields and filter out inapplicable records, you can create a Salesforce Report. This gives you a targeted export, omitting unnecessary data. Once configured and saved, you can reuse this report before each bulk merge operation.
In Salesforce, if the Reports tab doesn't appear at the top, click the App Launcher icon (nine squares) in the top left corner and search for "Reports."
Create a new report based on the specific data type, and add all the desired fields. Add filters to narrow the results. Save and Run the report.
On the results page, click the arrow next to the Edit button and select Export. In the Export popup, select Details and CSV as the format.
Export All Data for a Record Type
To get all field data for all records of the same type, you can use Salesforce's Data Export Service. There are no filtering/segmenting options, so if you have a large dataset, this can take a while to run.
In Salesforce, navigate to Setup > Data > Data Export.
Click Export Now, check the box for the record type, then click Start Export. You'll receive an email when the file is ready for download.
Additional Resources
Frequently Asked Questions
Check out the Merging Duplicates FAQ for a complete list of questions about merging HubSpot duplicates.
Related Help Articles
- Merge Duplicates Troubleshooting
- Deduplicate Salesforce and HubSpot While Keeping the Sync Active
- Deduplicate Across Salesforce Leads and Contacts
- Restore Merged Salesforce Records
Related Blog Posts
- Salesforce Duplicate Management: How to Automate Salesforce Deduplication
- How Duplicates, Lead-to-Account Matching, and Lead Routing Impact Each Other (and Your Whole Company)
- Data Retention When Merging: Keeping Critical Data For Better Customer Experiences
- Hidden Duplicates: 11 Advanced Ways to Identify & Deduplicate Customer Data