Every employee needs to be assigned a group through a lookup column, and it doesn’t matter what group they’re assigned to. The group will also do a reverse lookup by employees to see what employees are in it’s group.
Here is the challenge.
Every employee needs to be assigned a group automatically when a row is created, and all groups need to be weighted equally in terms of row count.
So for example, if I have 200 Employees & 8 Groups, they need to be divided so each group contains 25 employees. And as employees are added, they need to be auto added to the group with the least amount of employees.
Create the tricky button to add people in people list and auto choosse a group :stuck_out_tongue. This button will create a people and choose the group with the minimum number of people (if checkbox = true). If more than 1 group has lowest number, it will be made by random
that is indeed a nice puzzle as @Quentin_Morel said, I propose a different set up.
I created a table with 187 employees (I use dummy data). and permit the user to select one of the groups that is left, in this case only 3. I created the groups using a randomItem() in the value for new rows.
Hey nice one @Christiaan_Huizer, but do you confirm you have to manually chose an “available” group ?
Ly proposal is the one I found to perform the trick automatically. Also tried to put the RandomItem() directly in people database, but it processes again when you add a new people, even fit update put to false…
Always a pleasure to help ! FYI I also implemented in the doc a page with “autofill for new row”, so that you dont need to have buttons, it will auto select a group when you add a row in people database.