Power Automate

Merge Duplicate Lead

The Challenge

One of our clients has the requirement that in their Dynamics 365 Sales leads are getting created from various outsource so they want to merge duplicate leads and delete the latest one and attach contact and account with the lead.

The Solution

We developed a Power Automate Flow in which we have performed the below steps:

  • Fetched all the lead records sorted by created on ascending.

  • On the basis of email address and name if we find a duplicate lead then updating values of empty fields of old lead with the values of new lead’s fields.

  • If there is no contact and account attached to old lead then we have checked in CRM if the required contact and account exist, if not then we have created new and then attached it with lead else we directly attach those contact and account with that lead.

  • After doing so we have deleted the new lead record from CRM.