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))
);
WarrenBelz
85
Most Valuable Professional
Michael E. Gernaey
65
Super User 2025 Season 1
mmbr1606
55
Super User 2025 Season 1