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 Apps / Topic Solved /// Rando...
Power Apps
Unanswered

Topic Solved /// Randomly generated Person

(0) ShareShare
ReportReport
Posted on by 8

Topic Solved ///

 

 

Hello everyone,
I am currently in the process of developing an app that generates random pairs of two from a collection of employees (approx. 20).
At the beginning, I want to be able to select the number of calendar weeks from a dropdown list how many of these operations should take place.
An employee may only be grouped with the same person once per calendar week and if several calendar weeks are generated, the same 2 employees may never be grouped together. I hope that I have expressed myself clearly.

I already have the code that generates the pairs for one run. But how I now have to rebuild the code for multiple passes (and in such a way that the persons are checked), I don't understand.

 

+ At the end, the generated list must be patched into the SP list (chat partners are Office365 person columns!) and displayed separately by calendar week.

 

Does anyone have any ideas? if anyone has a simpler idea, i am grateful for it.

 

The Code for now is this one:


ForAll(
Sequence(CountRows(colEmployeesAll) / 2),
Collect(colChatPartner,Last(FirstN(colEmployeesAll,RandBetween(1,CountRows(colEmployeesAll)))));
RemoveIf(colEmployeesAll,ThisRecord in colChatPartner);
Collect(colChatPartner,Last(FirstN(colEmployeesAll,RandBetween(1,CountRows(colEmployeesAll)))));
RemoveIf(colAcademyAll,ThisRecord in colChatPartner);
Collect(
colChatCouple,
{
ChatPartner1: Last(FirstN(colChatPartner,1)),
ChatPartner2: Last(FirstN(colChatPartner,2)),
CalendarWeek: ISOWeekNum(Today())
}
);
Collect(SPList, colChatCouple);

RemoveIf(
colChatPartner1, Not(IsBlank(ThisRecord))
);

I have the same question (0)

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 301 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 297 Most Valuable Professional

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard