Use Power Automate to Assign Records Based on Territory Manager

Introduction

If you’ve ever assigned a new manager to Sales Territories in Dynamics 365, you know there’s no easy way to reassign all the associated records to that territory. That was the case before, but not anymore! With Power Automate, we can easily trigger a flow on the update of the Territory Manager field and use Power Automate to assign records such as all the leads, accounts, and other records associated with the territory. The same would apply to contacts, opportunities, and other activities associated with the account. The assigned operation will cascade down to those records since the account entity has a parental relationship with contacts and opportunities.

Learn more about our Power Automate services!

You can edit the relationship properties if you do not want the assigned operation to cascade down. To update independent records that are not related to an account, the following method can be used:

Walkthrough: Use Power Automate to assign records

Let’s break down the steps.

  1. First, we must trigger a flow whenever the manager field updates the Territory record.
  2. Then, we need to get all the associated Leads and Account records.
  3. Next, we need to iterate over them and update the owner.

We’ll use the recommended Common Data Service (current environment) connector instead of the other 2: Common Data Service or Dynamics 365. Common Data Service and Dynamics 365 are limited in what actions they can perform and have limited configuration options.

We’ll set the trigger condition to “Update” action, entity name as “Territory”, and we’ll set the scope to “Organization”. We’ll also filter on the “managerid” field as we don’t want to trigger the flow on any other updates to the territory record.

Read more: Power Automate Desktop: Streamline Your Workflow

Unlock the Power of Automation for your Business!

Are you looking to streamline your business processes with Power Automate? Dive into the world of automation with AlphaBOLD, and let us show you how to transform your workflow efficiency.

Request a Demo
this image shows Data Service or Dynamics 365. Common Data Service

We’ll use the OData filter to get associated Leads and Accounts and only select open and active records. We don’t want to update qualified or disqualified leads or inactive account records.

this image shows OData filter to get associated Leads and Accounts - Use Power Automate to Assign Records Based on Territory Manager

We’ll apply it to each component and iterate over each record. We will use the Update action to set the “OwnerId” to the new “Manager” field value.

this image shows component and iterate over each record - Use Power Automate to Assign Records Based on Territory Manager

We can utilize the parallel branching in Power Automate to speed up the operation by updating Leads, Accounts, and any other entities in parallel.

Read more: How to Use Power Automate to Enhance Power BI

Enhance your Productivity with Power Automate!

With AlphaBOLD's expertise, unlock advanced automation solutions that save time and reduce errors. Embrace smarter work processes now.

Request a Demo

Conclusion

That’s all there’s to it. With a low-code/no-code approach, we could quickly assemble a use case, whereas previously, it would have required a custom .NET workflow. We hope that this blog brought clarity to your Power Automate endeavors. Try it out, and let us know your thoughts in the comments section below.

Happy Assigning!

Explore Recent Blog Posts

Infographics show the 2021 MSUS Partner Award winner

Related Posts

Receive Updates on Youtube