Thanks Vaun. Actually I was just mentioning this not working for bots to give others a heads up. One of many things that don't work in bot flows, but in this case you still can choose it from the expression editor.
I did work around the issue by doing my own "random" logic (which is far from even pseudo random, but it did meet my needs).
I'm using the following:
ToInt( Task.maxBounds * (Second( GetCurrentDateTimeUtc() ) / 60 ) )
Where Task.maxBounds is the upper limit. Yes, not the most "pseudo random" (especially if you keep calling it after one another), and can't support more than 60 numbers, but met my need as a temporary workaround (better would be to pull milliseconds out of GetCurrentDateTimeUtc() and then parse out the ms range, but since there is no Milliseconds() function, it would be a bit more work - and for my current needs wasn't necessary).
Your idea of doing this from a standard flow would definitely work as well, though I actually need a repeated list of random numbers and dont want to keep entering and exiting the bot. Had thought about using the standard flow to generate a collection of pre-collected random numbers and just have the bot iterate through these as needed, but also overkill for my current needs.
But this simple "issue" does highlight how inconsistent Genesys Cloud Architect is with support between different flow types, even for something as simple as this. Keep knocking my head in Architect against things that SHOULD be simple but instead require (sometimes elaborate) workarounds. Definitely NOT the most intuitive interaction flow environment I've used (probably one of the least in many ways).
------------------------------
Brian Raynor
Principal Architect
Verizon Business Group
------------------------------
Original Message:
Sent: 05-26-2023 02:40
From: Vaun McCarthy
Subject: Random Number Generation in Architect
Hi Brian
Would it work if you generate the random number within your inbound message flow then pass it to the bot flow as an input variable? Does it really matter where it gets generated as long as it's random?
------------------------------
Vaun McCarthy
Original Message:
Sent: 05-25-2023 10:39
From: Brian Raynor
Subject: Random Number Generation in Architect
RandomInt() and Random() do NOT appear to work in bot flows, even though the functions "technically" are recognized. Ran into this yesterday.
------------------------------
Brian Raynor
Verizon Sourcing, LLC
Original Message:
Sent: 02-08-2023 13:58
From: George Ganahl
Subject: Random Number Generation in Architect
As @Melissa Bailey pointed out and @Blake Anderson spelled out, there are now functions in Architect to get random numbers.
------------------------------
George Ganahl GCP (Genesys Cloud)
Principal PS Consultant
Genesys
Original Message:
Sent: 11-03-2020 11:27
From: George Ganahl
Subject: Random Number Generation in Architect
As a few of you know, there is no function in Architect to generate a random number.
There is an Idea that has been sitting around, only has 5 votes:
https://genesyscloud.ideas.aha.io/ideas/CLINB-I-219
I, personally, would love to see that boosted a lot higher...
#Routing(ACD/IVR)
------------------------------
George Ganahl GCP (Genesys Cloud), ICCE
Principal PS Consultant
Genesys
------------------------------