I have a flow set up to take a new email from a group email box, create a planner Task and add any attachments to it.
I now want to incorporate into this way of working, automatic assigning of these tasks to a team of people.
So I have 6 people who will work on the tasks. As each new task is created I want the flow to assign one new task to user 1, the next new task to user 2, next to user 3 etc. and keep looping this through all 6 people, effectively evenly distributing the workload every time tasks are created.
I have a sharepoint list set up with the users microsoft ID number which I obtained from Delve profiles to put into the "add assigned users" field in the Task.
I'd also like to factor in holidays, for example in the sharepoint list I have an availability status of "Available" and " Not Available" so if we change the status of someone who is out of office to "Not Available" it takes them out of the loop of tasks being assigned until they are put back on "Available".
It feels like this should be possible to do using an array and some filtering maybe? but I'm new to flows and I can't quite get my head around how arrays are working to figure it out.
Does anyone have any ideas?
Hello @Anonymous ,
Your idea of looping though the users will work, but flows cannot run forever, and it will "forget" what number it is at. I would suggest adding a column to your SharePoint list called "Next task" and set it to "1". Each time the flow runs, have it check that column and assign it to a variable. Based on that number assign the task using a switch. Then when the flow is over increment the variable by 1 and save it back to the SharePoint list. But also check to see if it will equal 7, if it does, set it back to 1.
I hope this makes sense to you; it makes sense to me in my head.... but that's not always a good thing.
Hi @Anonymous ,
I have the same opinion as @FoDelement
From your description, if one email arrives, task 1 will be created then assign to a user 1; task 2 will be created then assign to user 2 when the next email arrives, and so on, right?
If so, you can follow these steps to meet your requirements:
This is an example of a SharePoint list:
This is the overall structure:
These are illustration of the structural details, and the points that need to be noted are highlighted in the red line:
Thank you for your input.
I followed the flow steps provided and the flow is now rotating between the 6 email addresses in the sharepoint list and assigning them the next task created, updating the availability status between "Available" and "Null".
When I set a user to "Not Available" to exclude them from the task distribution, the status is being overwritten by the flow and assigning it a new value of either "Available" or "Null", putting the "Not Available" person back into the rotation.
I considered simply deleting that user out of the sharepoint list manually temporarily and adding them back in upon their return, but I imagine this will then break the flow as a new sharepoint ID number will be assigned when they are added back in, taking it above 6?
It is working great. Thanks for the efforts. I believe due to the clarity of the image some people might miss the do until part and add them in a stand alone actions. I used it for approvals and it's working great.
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!