1. Home
  2. Job Reference
  3. Unit Pipeline – Merging Units

Unit Pipeline – Merging Units

Sometimes, multiple units with the same contact details, such as email or phone number, are accidentally saved. This can cause issues in processes that search or filter by these fields. This guide shows you how to configure a Unit Pipeline job to find and merge all duplicates.

Merge by email

The steps below show how to find all duplicates on the account based on the email address, and merges them.

  1. Add a Find duplicates step
    Choose the type of duplicate to detect; email or phone. This step will get all units with duplicate values from the account.
  2. Add a Merge units step
    • Group by expression
      • Use our standard syntax here, for example: {{this.email}}.
    • Merge Target
      • Select whether the newest or oldest unit should be the target.
      • The other unit(s) will become the source.
    • Merge Action
      1. Currently, the only available option is Overwrite old unit data, which updates the target using data from the source(s).
    • After merge have source
      • These are the units that are merged into the target.
      • Choose what should happen to them after the merge:
        • Remove from account
        • Remove from loaded resource
        • Save to a new resource
      • For our purpose, select Remove from account.
    • After merge have target
      1. Choose what to do with the resulting target unit.
      2. Select Save to new resource so the merged units are available later in the process if needed.
  3. Add a Save to account step
    • This step saves the updated units to the account.

Merge by metadata

Merging can also be done by metadata key and instead of searching for duplicates on the account based on the email or phone number, you can load units from a group or a resource.

  1. Add a Find units step
    • Decide if you want to get the units from a group or a resource. In the example below, we’ve selected Retrieved followed by From group as the source.
  2. Add a Merge Units step
    • Use our standard syntax here, for example: {{this.metadata.customer_id}}
  3. All other settings are the same as the steps above.
Updated on 2025-07-29

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support