Is this possible? Picking a value from a column at random with a set column action…

The use case:

A user is ready to make a video call with an agent
There are agents available (agent table, and a Boolean is available = true)
The user clicks on a button “lets go”

Is it possible to have a compound action that:

  • picks an email at random from the available emails
  • writes it the ‘this item’ row

(I have other messy things afterwards, but this is one piece of a possible solution).


get max available agents and do this formula in Gsheet
=ROUNDUP( RAND()*max(agents row number))
you need to first filter all available agents, and have column with ROW() numbers…
than just filter the agent with the result row number

Thanks…. Thinking through more of the situation:

Agents is a GS table - mostly static content
50+ agents…. But only 5-10 might be available to be assigned

I need to do as much as possible within glide - as the 5-10 second time lag is the actual reason for my problem. ((Currently an agent assigns themself a user, BUT they write into a single column, say ‘email assign’ but the other devices might have someone else come in during the 10 second delay…. Overwriting the first)). ((And this is the GT in the same app)).

I’d also need to get the agent values somehow. I did try to do a single value from an if-then-else in the agent table in glide …. But it was picking up blank values as real values :(((

I think so!

1- Create a Simple Value Column using the Random option


2- later, use a Reshuffle action to have a newer list at anytime

Saludos Mark

1 Like

you wont have a delay, because is pre calculated

How do you handle blanks? 50 agents, only 5 free = 45 blanks.

Youd need to relate the list of avail emails to the sheet of emails and then use a single value on the relation.


Ummm… let me try and play with a Joined List!

i made you a sample in our team sheet @Mark_Turrell



Thanks! I’ll have a play tomorrow :slight_smile: much appreciated:)

1 Like

if i could suggest you deferent way… not by random… but which agent is waiting the longest… random might use one agent more often than others. So just put the timestamp when agent pick up the call and sort them by earliest time first. and in this case blank values by default are the earliest (in Glide, and latest in G sheets) and i would randomize only blank timestamps if there are any)
I added a new version in TEAM Sheet. @Mark_Turrell

1 Like

I cobbled together something to pick an agent almost at random.
You need a trigger to generate a number, so if you give each user a number when they arrive (or by one button), it triggers a random one and therefore an agent selection.
It’s not the top of the random, but if it’s for all the agents have a work, it does the job.
Here is a small test application.

there is a link to a documentation for the random generation. in case !

Could you use a compound action that when an Agent makes themselves available, it not only changes a boolean, but also sets a Date/Time Column with current date and time?

Then you can sort the list of available agents based on latest time available and assign a person to the first agent in the list.

And once assign, set Agent to not available.

This would be a more fair round robin vs random.