Random select People

Hi Community!
I am trying to build a Buddy system. The idea is that each week, users that want to have a buddy to talk to, go to this table and add their name and then they get a buddy assigned.

In said table, I created a button column, and I used this formula [Buddy Log].nth(roundup(random() * [Buddy Log].count(),0)) to randomly assign a buddy.

Now I am facing some issues I’d love help fixing:

  1. A cannot be assigned to A. So we need to have the formula exclude the user’s name from the randomize list;

  2. All the users are added to the table. So there will be one row for each A, B, C, … If in the A row, A is assigned to B, in the B row, B needs to be automatically assigned to A, so it makes sense and people are paired together;

  3. If B is assigned to A, B and A cannot be assigned to any other letter/user. I guess the exception to this would be if we had an uneven number of users, and in this situation we would have 3 users paired together, so no one is left out.

Here is my doc, in case it’s useful to visualise. https://coda.io/d/Buddy-system_dg7uzU30I52

Can anyone help please? :pray:

Hi @Marta_Oliveira,

I added some functionality in your doc.
Still didn’t tested it extensively, but it seems working now.

Let me know if it helps.

If you pick users randomly, it’s hard to completely avoid this situation.
So either you optimise the selection (e.g. jump one and take the following one circularly), or you might left out of alternatives in some combinations and then sort it our manually.

Thanks for your help @Federico_Stefanato ! It works amazingly!

1 Like