You have accidentally created multiple records for the same customer. Each of these records may already have related child records (e.g., order history, communications). Once you detect the duplication, you want to:

  • Keep one master customer record
  • Move all related child records from the duplicates to this master
  • Delete the duplicate customer records afterward

Let`s create a database that will identify all the parent records with matching names and allow us merge those records into one with a button click.

Identify Duplicate Parents

In the Parent table create a many to many relation with itself. This relation is needed to identify duplicate parent records and collect those records in a recordset column.

First column under this relation will calculate the duplicate count. Create a summary column [Duplicate Count] with the following filter condition: [Name]=Related[Name] and [Id]<>Related[Id]

In our example a record is considered to have a duplicate if another record with the exact same name exists. Therefore, we will create a second column – recordset – will pick up all the existing duplicates.

Collect the Child Records

We need to identify the child records that need to be moved to the main record when the duplicate parents are deleted.

Our Parent – Child tables already have a relation. Now let`s add a Child Records Recordset column that will keep our details.

Create a Button To Merge Duplicates

Set up a custom button named Merge Master on the Customer table. By clicking this button user can initiate merging of duplicate records.

Identify Master and Remove Duplicates

Now we need to add the workflow actions.

The first action — “Fill Merge Id” — will assign the ID of the main record (the one we will keep after merging) to each duplicate record. We will use the recordset of duplicates created in step 1. If you don’t have that yet, a [Master ID] text field must be created in the parent table to store the ID of the main record that will be kept after the merge.

This second workflow action can optionally either mark duplicates as inactive or delete them entirely (based on your data retention policy).

We will configure it to delete the remaining duplicates.

Move Child Records to Master Record

Now we need to make sure that all the child records “migrate” to the main parent record.

Whenever the button is clicked and the [Master Id] is populated on the parent record, the trigger calls an action to change the “owner” of the details (child records).

In the workflow:

  • In all child records where "Parent" = "Duplicate Parent
  • We need to update those child records to set "Parent" = "Master Parent

With the Merge Master button and a carefully crafted workflow trigger, you can handle duplicate customer records in TeamDesk cleanly and automatically. This is a powerful way to maintain data hygiene in any application that involves complex relationships between parent and child tables.
Check out the template with all the settings here.

Date
Share