web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate - Name ...
Power Automate
Suggested Answer

Power Automate - Name / Task Randomiser

(0) ShareShare
ReportReport
Posted on by 2
Hi everyone,
 
In my team of three employees, everyday we do approvals at 08:30, 11:30 and 15:30. I'm looking to set-up a randomiser that allocates a person to a slot each day, Monday-Friday and sends at 8am to all three employees on the day. 
 
It needs to randomly pick each of the three names and allocate them to one of the three slots. Each name should only be repeated once but every name needs to be included.
For example, employee2 should only do one slot and not two slots across a day.
 
Example of how it should work:
 
Day 1
08.30: Employee1
11.30: Employee2
15.30: Employee3
 
Day 2
08.30: Employee2
11.30: Employee3
15.30: Employee1
 
NOT CORRECT (missing employee1 and employee 2 repeats twice)
08.30: Employee2
11.30: Employee2
15.30: Employee1
 
I've tried to set this up using ChatGPT as a guide but it the instructions go beyond my capabilities sadly!
 
Is anyone able to advise on how to create this?
Categories:
I have the same question (0)
  • Suggested answer
    Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at
    Albert-Jan Schot has a nice example workaround for this, a shuffle method. Maybe that is a good alternative?

    You can use rand, skip, take and union functions in an expression for this.
     
    Below is an example of that approach adjusted to your data.
     
    RandomStart variable
    rand(0,2)
     
    Compose expression
    union(skip(variables('EmployeeArray'), variables('RandomStart')), take(variables('EmployeeArray'), variables('RandomStart')))
     
  • fhunth Profile Picture
    4 on at
    Use this prompt in chat gpt or Gemini:
    in a power automate , i have an array with 3 usernames, generate a random between 1 and 3, get that randomnumber and add it to a new array , then delete it from the initial array, repeat 2 more times
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    Add a (big) random number to the items and sort by this number:
     
     
    Select 2
    "Name""@item()",
    "Position""@rand(0,100000)"
     
    Compose
    "Day""@items('Apply_to_each')",
    "Slot1""@sort(body('Select_2'), 'Position')[0].Name",
    "Slot2""@sort(body('Select_2'), 'Position')[1].Name",
    "Slot3""@sort(body('Select_2'), 'Position')[2].Name"
     
    Compose 2
    @outputs('Compose')
     
     
  • KM-19091448-0 Profile Picture
    2 on at
    @Expiscornovus Thanks for your input on this. The flow does seem to work using this - but I notice Employee3 is rarely chosen as the first in the order, which I believe comes down to being a maths issue, rather than anything actually being wrong with the flow. Is there a way to increase the likelihood that employee3 will be first in the sequence? I read the link attached and tried following instructions from Gemini and ChatGPT but both seem to start giving instructions that refer to actions that haven't been listed in the steps (referring to non-existent arrays, etc).  Both AI seems to want to include SHUFFLE or expressions like rand(0, length(AvailableIndexes) - 1) that comes up as invalid or aren't available on my version of power automate.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard