Hi All,
Is there a way in the In-Queue flow to play a set of prompts (ads) in random order every time a call arrives ?
Regards,
Hussein
Hi All,
Is there a way in the In-Queue flow to play a set of prompts (ads) in random order every time a call arrives ?
Regards,
Hussein
How many prompts are you talking about?
Let's say 5-8 prompts.
If you want a truly random number or order, write a service that generates one and use the Call Data Action to invoke it.
To get a semi-random number, you can use the second the call entered the flow or of the current date time. This will give you a starting point. Unfortunately that only gives you 1 random number, not a sequence of them. In the future we will add some collection functions that would make this possible. In the meantime, would either of these options work for you?
ToAudio(Task.collection[Second(GetCurrentDateTimeUtc())% Count(Task.collection)])
This would randomly play 1 prompt each time the in-queue task iterated; however it's not guaranteed to play a different prompt each time depending on how much time passes between iteractions. For example if there are 8 prompts, the 1st iteration plays prompt1 that is 6 seconds long and does something else that takes 2 seconds, the 2nd iteration would play prompt1 again.
Second(GetCurrentDateTimeUtc())% Count(Task.collection)]
If either of these don't work, it is technically possible but it would be very complicated with lots of nested loops.
Thank Melissa, I will give it a try and see.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.