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
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 :(((
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
Hi,
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.
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.