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 Field Data Retention reference.
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 the Duplicate Identification Rules reference for a complete breakdown of every option.
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 the CSV Tab Reference 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 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 the Master Record Selection reference 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 the Field Data Retention Reference below 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 the Method Tab Reference 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 Troubleshooting section below for more details.
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 Salesforce Accounts and Corresponding HubSpot Companies While Sync is Active
Having your Salesforce and HubSpot CRMs set up to sync can make cleaning up duplicates tricky. You need to determine the appropriate “master record” to use across both CRMs and consider the merging process. Often, your settings in each platform impact how the merge takes place.
When you deduplicate accounts in Salesforce, the master is kept in sync with the original HubSpot record, indicated by a Salesforce Account ID value. However, the deduplication only takes place on Salesforce, leaving duplicate companies in HubSpot. Since HubSpot doesn't allow you to deduplicate companies while the sync is active from within the HubSpot app, you need another option.
Insycle allows you to merge duplicate HubSpot companies and Salesforce accounts while keeping things simple and your sync intact.
To learn more, see Deduplicate HubSpot Companies and Salesforce Accounts.
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 advanced techniques in our Deduplication Scenarios article.
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.
Troubleshooting
If you're not seeing the results you expect when merging duplicates, consider these issues:
"Failed" Result in CSV with "Change rules in Step 3 'Master Selection'" Message
If the Result is "Failed" and the Message column of the CSV report displays this text:
Change rules in Step 3 'Master Selection'. Failed to pick master record because multiple records (X) meet the selection criteria. In 'Master Selection', change, add, or reorder the rules such that only one record matches (if cannot determine master based on field values, use 'Record ID is lowest' as the last rule).
This means Insycle could not determine which record in the duplicate group should become the master — none of the records meet more of the rules than the others.
There are a few things you can try to resolve this:
-
Under Step 3, on the Master tab, experiment with reordering or adding rules based on fields that are likely to have unique values across your records. Think about what matters most to your business — the fields that would make one record clearly more valuable or authoritative than another. For example:
- A field that stores an ID linked to an external system, such as an ERP, data warehouse, or proprietary internal tool — the record with that ID populated is likely the one your other systems depend on
- The record with the highest number of associated records (contacts, deals, activities) — indicating it has accumulated more history and relationships
- A field indicating CRM ownership or account status — for example, a record marked as "Customer" vs. "Lead," or one with an active owner assigned
- A field that tracks revenue, subscription tier, or engagement level — the record with higher values may represent the more complete or current entry
- A custom field your team uses to flag record quality or data source reliability
The goal is to surface the fields that reflect record importance for your specific operations, not just default system fields.
-
Also on the Step 3 Master tab, confirm that By Priority is selected rather than Absolute.
With By Priority, a record only needs to match one rule to be selected as master. With Absolute, a record must meet all rule criteria, which makes it much harder for any single record to qualify.
In most cases, By Priority is the right choice. If By Priority is already selected and the error persists, none of the records in the group meet any of the criteria more than the others. Return to the Master tab and continue adding or reordering rules, focusing on the business-critical fields described in #1 above.
- As a last resort, add a rule on the Master tab that uses Record ID is lowest, or Create Date is earliest. These rules will always produce a unique winner, ensuring master selection can complete even when other field-based rules cannot differentiate the records.
Non-duplicate records are being merged together
There are a couple of things to look at that may be causing records to be misidentified as duplicates.
First, you may need a better unique identifier. Under Step 1, if you use only fields that can correctly contain the same values across multiple records, they aren't unique identifiers. In this case, you are likely to identify unrelated records as duplicates and may accidentally merge them.
Unique identifiers are data unlikely to be shared by any other record unless they represent the same underlying entity. Common fields used for deduplication include phone numbers, email addresses, mailing addresses, and ID numbers.
Second, this may indicate the Comparison Rule under Step 1 is too broad. Try using the Exact Match comparison rule instead of the Similar Match rule. Similar Match looks for values that may be close, even with a one-character difference (e.g., a typo), broadening the search.
Remember to always run your deduplication in Preview Mode to confirm it's working as expected before running it in Update Mode and applying the changes to your CRM records.
Insycle isn't finding any duplicates
Most of the time, when Insycle can't find duplicates, it is due to your matching rules in Step 1. It is important to analyze the underlying data to better understand how to set up your rules. A helpful exercise for contacts is to set up your matching filters to find exact matches on only First Name and Last Name. For companies, you can use Company Name.
When you click Find, these rules can show you a broad overview of what duplicates are potentially in your database and what fields might be useful to include in your matching fields. These settings are just for discovery and should not be used for a final merge operation; many people can have the same first and last names and are not duplicates.
To get further context, on Step 2, click the layout gear button on the right side of the title bar. Here, you can add any field from your database as a column in the duplicate group review to better understand the data in these records. These will also appear in your CSV report.
Not all identified duplicates are merging into the master
You have duplicate records that have been identified by Insycle but not all of them are merging into the master.
Look at the Exclusions at the bottom of Step 3 to see how many duplicates are in the affected duplicate groups. If you have duplicate groups with more than 5 records, you may want to change the Skip duplicate groups with more than [5] records per group setting to ensure you get all of them.
This 5-record default is intended to prevent accidental merging of non-duplicate records when the filter in Step 1 is too broad.
Some fields are missing in the Fields tab dropdown in Step 3
Field rules in Step 3 can only update writable fields. Read-only fields are not shown in the Fields tab dropdown because the CRM prevents these properties from being written back. Insycle excludes them from the field selection options to prevent errors.
While you cannot create field rules for read-only properties in the Fields tab, you can use them in the Master tab. Read-only fields, such as "Last Activity Date," can be used to make merge decisions without attempting to modify those properties.
You can also use read-only properties for filtering and matching in Step 1. Read-only fields are also available when reviewing data in Step 2 or in the CSV report.
To identify which fields are read-only, use the Cleanse Data module. Navigate to Data Management > Cleanse Data, then select a database and record type from the top menu. You can search for a specific field by name or click the Writable heading in the table to sort and review all writable or non-writable fields. A checked box in the Writable column indicates the field is writable.
It's taking a long time for Insycle to find duplicates
It can take Insycle a while to find and match duplicates when the fields used to identify them have very long values. The longer the values, the longer it takes Insycle to process the data and generate the results. This might come up when looking for matches based on long ID numbers, LinkedIn bio links, or other URLs with long strings attached (ex, https://www.linkedin.com/in/svadin%C3%ADr-n%C4%9Bmec-1234b31a3/).
You can speed this up by limiting how much of the value Insycle looks at.
If the beginning or ending portion of the values are all unique, you can limit the comparison to the first or last several characters using the Match Parts parameter under Step 1.
Or use the Ignore Text (Substrings) parameter, then click the Terms button.
On the Ignored Text tab of the popup, add the common portion of the URL or text string.
I get a Salesforce error in the Merge Result popup
Occasionally, after you run a merge operation, you may see the message: "Underlying error message from Salesforce" in the Merge Result popup. This indicates there is an issue on the Salesforce side that needs to be investigated in Salesforce. One example of this error is shown in the screenshot below: "Underlying error message from Salesforce: Use one of these records?"
It's worth checking for any rules relating to the record type in the Duplicate or Matching Management settings for your Salesforce account.
Go to Setup > Data > Duplicate Management > Duplicate Rules or Matching Rules.
You may need to turn these rules off before Insycle can proceed with the merge to prevent the error. You can either completely disable them to manage all duplicates through Insycle or disable and enable the rules as needed.
I get a message to contact Insycle in the Merge Result popup
If you are running a bulk merge operation on custom objects for the first time, you may see the message "Please contact support@insycle.com to enable bulk merge for type: [Custom Object Name]."
By default, you can manually merge custom objects that have been synced with Insycle, but before you can bulk merge duplicate custom objects, they must be enabled for your account. This message indicates the step has not been completed yet.
To enable bulk custom object merging for your account, please contact Insycle support by email at support@insycle.com or via the live chat at the bottom of every page on the Insycle website or in the app.
Learn more about using custom objects and fields in Insycle.
The image below shows the Bulk Merge Result popup showing the "Please contact support@insycle.com to enable bulk merge for type: Custom Demo" message.
For more help troubleshooting issues with Insycle, refer to our Troubleshooting Issues article.
Additional Resources
Frequently Asked Questions
Check out the Merging Duplicates FAQ for a complete list of questions about merging HubSpot duplicates.
Related Help Articles
- Deduplicate Salesforce and HubSpot While Keeping the Sync Active
- Customize Bulk Deduplication Using Exclusions and Pre-Defined Masters
- Deduplicate Across Salesforce Leads and Contacts
- Manually Merge Duplicates
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