A place to ask questions, connect with others, and stay in the know
You can use a random function that returns a random decimal between 0.0 and 1.0. Use this building block in decision actions to steer interaction based on whether the expression evaluates to true or false. For example, Random() < 0.25 can send 25% of interactions down one path and 75% of interactions down another path.
You can also use a random function to retrieve an integer within a given range. This function enables you to more easily use the function in cases where an integer is required. For example, RandomInt(100) returns a random integer between 0 and 100. Negative inputs return negative integers.
RandomInt() and Random() do NOT appear to work in bot flows, even though the functions "technically" are recognized. Ran into this yesterday.
Yeah, I would just take the milliseconds from the current time then multiply it against the seconds then I would do a right or left for the number of characters I need. You do run the risk of there being 01 or 001 values, so you would need to include a fixed number or other parts of the date time to append, multiply, etc to ensure that you get a truly large and random number as output.
Hi BrianWould 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?
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).
Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources
Genesys empowers more than 7,500 organizations in over 100 countries to improve loyalty and business outcomes by creating the best experiences for customers and employees. Through Genesys Cloud, the #1 AI-powered experience orchestration platform, Genesys delivers the future of CX to organizations of all sizes so they can provide empathetic, personalized experience at scale. As the trusted, all-in-one platform born in the cloud, Genesys Cloud accelerates growth for organizations by enabling them to differentiate with the right customer experience at the right time, while driving stronger workforce engagement, efficiency and operational improvements.