Loading...

Round Robin assignments in Power Automate

Round Robin assignments in Power Automate

When distributing tasks or tickets across a team, fairness matters, and so does flexibility. With Power Automate, we can implement a round robin pattern that always picks the next person in line, and wraps around once we hit the last.

I got asked by a customer on how to achieve this - so it might be helpful to you as well.

What we’re solving

Let’s say your team handles incoming forms—support requests, process suggestions, or tickets. You want those distributed evenly across your team, but also automatically.

The round robin logic makes sure that in a team 3 people:

Request # Assigned to
1 Person 1
2 Person 2
3 Person 3
4 Person 1 again

… and so on. No skipping, no duplication, no manual effort.

Setup

SharePoint list: AssignmentIndex

Create a simple list called AssignmentIndex. It only needs one row and one column (besides the Title):

Title LastIndex
Assignment 0
  • LastIndex must be a number column
  • This acts as memory across runs, telling us who got the last task

Microsoft Forms form

Set up a basic form with questions like Title, Description or similar. We will use this to trigger an upcoming support request.

Flow overview

flow overview

Let’s break this down into steps:

Microsoft Forms trigger

Use the trigger When a new response is submitted

Get Form Details

Use the actions: Get response details, this gives us the data we want to assign: title, description, urgency, etc.

Initialize MemberList

  • variable of type Array
  • leave value empty

Get SharePoint Index

Use Get items to pull the one row from the AssignmentIndex list. Use a filter condition Title eq 'Assignment'.

Initialize LastIndex

Now initialize a variable of type Float: body('Get_items_-_AssignmentIndex')? ['value'][0]?['LastIndex'] - this lets us store the value of the LastIndex column.

Get Microsoft Teams members

Use the action List members from Microsoft Teams connector to list the members of your Team. Select a team and channel from the dropdown. The output will be an array of team members (emails, names, etc.).

Get the email addresses

Add an Apply to each loop with the input: body('List_members')?['value']. Inside of the loop, add an Append to array variable - Choose the MemberList from the dropdown and put this into the value as an expression: items('Apply_To_Each')?['email']

This will loop through the array of objects we get from the Teams action, extract only the email addresses of the team members and add them to our array variable.

Calculate the new index

We now want to move one step/person forward in the team list. Initialize another variable NewIndex of type Float and use an expression:

mod(add(variables('LastIndex'), 1), length(variables('MemberList')))

This is where the magic happens. The mod() (Modulo) function will return the remainder of a division (dividend : divisor). In our case, it will give us the remainder of the division of LastIndex + 1 and the amount of items we got from the Memberlist variable (we calculate this with the length function).

What does mod() do here?

Let’s make that clear with a table:

LastIndex Team size NewIndex calculation Result
0 3 (0 + 1) mod 3 = 1 1
1 3 (1 + 1) mod 3 = 2 2
2 3 (2 + 1) mod 3 = 0 0

The mod() function ensures we loop back to the beginning after reaching the end of the list.

Now let’s finally find the right person to assign the new task to. We already know the NewIndex, all is left for us now is to get the NewIndexth (sic!) item from our MembersList: Add a Compose action and call it Assignee. Use this expression: variables('MemberList')[int(variables('NewIndex'))], which will then return the email address, and due to our round-robin logic it will always be the next person in the list. You might have noticed, that we make an integer out of our float variable - this is needed because the index needs to be an integer (as an index can’t be 9 3/4 or similar).

Assign the task

You can use this pattern for different use cases, for example

  • Assigned To fields (Planner, SharePoint, Approvals)
  • Emails
  • Logging

Do as you please, your Assignee action is now always the correct person.

Update the SharePoint index

Finally, don’t forget to update the LastIndex field in SharePoint List so we know who got the last assignment and the list stores the correct value for the next flow run.

Use Update item with:

  • ID = dynamic content ID from our Get items action
  • LastIndex = variables('NewIndex')

Done! 👌

Looking for more blog posts on Power Automate? I got you: https://www.m365princess.com/categories/power-automate/

Published on:

Learn more
Need help with this product?

We can help you with Round Robin assignments in Power Automate

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

You are holding GitHub Copilot Wrong!

Most developers think that one can’t really use GitHub Copilot wrong. There is a chat interface that lets you also choose a model, so th...

8 months ago

You are holding GitHub Copilot Wrong!

Part 0 showed why constant prompting, re-prompting, and steering GitHub Copilot feels fragile. Not because Copilot is unreliable, but because ...

8 months ago

Building a Multi-Hierarchy Ticket Classification System (Because Keywords Aren't Enough)

Look, I love a good keyword-based system as much as the next developer. They’re fast, predictable, and when your user says “VPN,&r...

8 months ago

Secretless cross-tenant dataverse access

Client secrets are like hiding your house key under the mat; easy to grab and impossible to audit. Certificates are just slightly better, beca...

10 months ago

How Azure CLI handles your tokens and what you might be ignoring

Running az login feels like magic. A browser pops up, you pick an account, and from then on, everything just works. No more passwords, no more...

10 months ago

How Dev Proxy teaches you to make your apps more resilient

I added Microsoft Dev Proxy to my Mermaid → Dataverse converter, because I wanted to test how it handled rate limits and API errors. What I go...

10 months ago

Building Azure functions that never store secrets — ever

What if your function could hit Microsoft Graph with no client secrets, no certs, and no Key Vault entries? That is exactly what a Managed id...

11 months ago

Introducing Mermaid to Dataverse Converter

Why diagrams matter (and why they usually fail us) Entity-Relationship Diagrams (ERDs) are the universal shorthand for talking about data mode...

11 months ago

It’s OK to be seen trying

It’s OK to be seen trying Somewhere along the way, we started believing that you’re only allowed to speak after you’ve figured everything out....

1 year ago

Stuck in pilot - Part 1: no foundations, no future

“We just need to test the AI. We’ll figure out the data later.” That sentence has quietly killed more AI pilots than any model failure ever ...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.