Dynamic InQueue prompts

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?

  1. Create a prompt collection named Task.collection, followed by a play audio step with this expression

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.

  1. Create the same prompt collection. Use
    Second(GetCurrentDateTimeUtc())% Count(Task.collection)]
    to pick a starting point in the collection, then play from that index to the end, then start at the beginning of the list and play until you back to the index.

If either of these don't work, it is technically possible but it would be very complicated with lots of nested loops.

1 Like

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.