How to implement Round Robin assignment via Power Automate?

October 2, 2024

Round Robin Lead Assignment helps teams optimize lead management, improve responsiveness, and create a fair workload distribution, which can lead to higher productivity and better customer engagement.

If you are here to learn what round robin assignment is and how to implement it using Microsoft Power Automate, a tool in the Microsoft Power Platform, keep reading.

What is Round Robin assignment?

Before diving into the technical steps, let’s briefly define what a Round Robin assignment is. Round Robin is a method used to distribute tasks sequentially to a group of users or team members. Each team member receives a task, and once the last person on the list is assigned a task, the cycle starts from the first person.

In Round Robin task assignment, leads are assigned one by one in a cyclical order, ensuring that each person gets an equal number of leads over time. The process continues in a loop, where after the last person in the group receives a lead, the next one is assigned to the first person again, and so on.

Key features of Round Robin assignment

  • Balanced distribution: Ensures that no one team member is overloaded with leads while others have too few.
  • Fairness: Each person in the group gets an equal opportunity to handle leads.
  • Automation: Often implemented using tools like Power Automate, CRM systems, or custom workflows to automate the assignment process, making it efficient and reducing manual effort.

How to implement Round Robin lead assignment?

Implementing Round Robin Lead Assignment can be automated through workflows or scripts using tools like Power Automate, CRM platforms (e.g., Dynamics 365 Customer Engagement and even Salesforce), or other custom solutions. Below is a step-by-step guide to implementing Round Robin assignments using Power Automate.

Why use Power Automate for Round Robin assignments?

Power Automate allows you to automate workflows across various applications and services. With Dynamics 365, you can use Power Automate to distribute tasks automatically and evenly among team members, saving time and improving operational efficiency.
Power Automate Round Robin assignment has several benefits, including:

  • Automates repetitive task distribution.
  • Ensures fair and equal assignment of leads, cases, or tasks.
  • Scales easily to handle large teams and dynamic member changes.

Steps to implement Power Automate Round Robin assignment

The first step in setting up a Round Robin assignment system is to track which team members should receive the next task. To do this, create a custom field in your Custom Dataverse bridge table in Dynamics 365.
Consider the example of assigning newly created accounts to your team members via Round Robin. To do this, you must create a bridge table in my database environment that is connected to the Accounts and Team (OOB) tables.

Create a Relation (one-to-many) of your Custom Bridge Table with the Accounts table.

Create another relation (many-to-one) with the Team table.

We now have two useful fields in our Bridge table for future use. In this scenario, the first is the ‘Current Counter’ of type integer, and the second is a lookup field for the ‘Team’ table.

Creating Power Automate flow in the Dataverse environment

Now let’s create Power Automate flow in your Dataverse environment to achieve Round Robin.

After creating MS Flow, use the Dataverse connector “when a row is created, modified.”

Choose your table and set the change type to Added. Initialize a variable of type integer and set the value to 1.

The purpose of this variable is to track the index. Now use dataverse trigger “get a row by ID.”

Choose your custom bridge table. In our scenario. Lead Assignment Indexes get the row ID of that table in row ID.

After this, use compose and get the team name from the above step, “get a row by ID.” The purpose of this compose is to check your team’s name.

Using Fetch XML

Now comes the crucial part: Listing the team users using FetchXML. To do this, use the Dataverse trigger ‘List rows.'”

Here’s Fetch XML:

Logic: In the following FetchXML, we compare the current counter value and check the team name

What is the purpose of the Fetch XML?

The primary purpose of this Fetch XML is to retrieve a distinct list of users who are members of a specific team. This allows for a balanced distribution of tasks or records among team members in a Round Robin manner. By fetching users in a structured way, the flow ensures that tasks are evenly allocated without duplication or oversight.

In the next step, use dataverse trigger “update a row.”

Choose your desired table and the row ID of that table (this procedure will be implemented for each loop automatically because we’re fetching more than one record).
After this, use the Dataverse trigger “List rows again.”

Choose Users Table and paste the following fetch XML in the Fetch XML Query Section:

<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”true”>

<entity name=”systemuser”>

<attribute name=”businessunitid” />

<attribute name=”systemuserid” />

<attribute name=”firstname” />

<order attribute=”fullname” descending=”false” />

<link-entity name=”teammembership” from=”systemuserid” to=”systemuserid” alias=”tm”>

<link-entity name=”team” from=”teamid” to=”teamid” alias=”t”>

<filter type=”and”>

<condition attribute=”teamid” operator=”eq” value= “Get Team name from Custom Bridge table”}”  />

</filter>

</link-entity>

</link-entity>

</entity>

</fetch>

Use compose action:

In the input section, use length(outputs(‘List_rows_2’)?[‘Body/value’]). this will return a numerical value.
Use the following conditions:

Compare compose value with current counter field value (custom table Field)

  • In the If yes section of the condition, use the Dataverse action “update a row.”

Update your custom table and set the current counter value to 1.

  • In if no section of the condition, use the Dataverse action “update a row.”

Update your Custom table and Increment Current Counter Value with 1 using the following expression:
add(outputs(‘Get_a_row_by_Id’)?[‘body/Logical name of your counter field],1)

In this section, if a newly created lead, account, opportunity, etc., has been assigned to the last team user, this section of the condition will update the counter to the next value to ensure no duplicate assignment happens.

In the last step, increment your Power Automate Variable Increment_Variable with 1.

Conclusion

Power Automate Round Rib assignment is a practical way to distribute tasks evenly or leads across a team. With its flexible design and user-friendly interface, Microsoft Power Automate allows you to customize workflows to meet specific business needs easily. Whether you’re automating customer service assignments or sales lead distribution, the Round Robin technique helps ensure fairness and balanced workloads, improving overall team efficiency. Integrating tools like SharePoint or Dataverse allows you to maintain transparency and track task assignments, ensuring smooth operations and better collaboration.

We hope this guide helps you successfully implement round robin using Power Automate. If you encounter any issues or need assistance with the implementation, reach out to us at marketing@confiz.com.