GetQueueEstimatedWaitTime

Can someone help me on how to use the new GetQueueEstimatedWaitTime or FindQueueEstimatedWaitTime found in Architect?
The expression states that this returns it as a Duration value. I want to evaluate the duration and state "if over XX minutes" present this message, if under then present alternative message.

I have created a update data block which uses the below and assigns it as the variable State.est:
GetQueueEstimatedWaitTime(FindQueue("QUEUENAMEHERE"))

Then another, setting the variable as a integer titled 'waittime', I believe this is now returning it as an integer but in seconds: If(IsSet(State.est), ToInt(ToInt(State.est) / 100), 0)

Then a logic switch block that uses the following expression (720 seconds is 12 mins):
State.waittime >= 720

However, basically almost every single customer is getting the message stating the wait time is over 12 mins, even though some are only waiting a couple of seconds and when I use the Est wait time via API rather than via this function the est wait time is often much lower than 12 mins if not 0 or a minus figure. How do I account for the minus or 0 figure and how do I get it to be more accurate?

Cheers,
Eilidh

A simpler expression would be

If(IsSet(State.est), State.est > MakeDuration(0, 0, 12, 0), true)

In your expression you need to divide by 1000 not 100. ToInt of a duration returns the value as milliseconds, i.e. 1 second = 1000 ms. You're calculating the values as 10 times higher than they really are.

An EWT of 0 or -1 can happen for several reasons, see https://developer.genesys.cloud/routing/routing/estimatedwaittime-v2#special-cases-and-fallback-strategy

I've tried using both the "Find" and "Get" new EWT functions. In each I'm getting back something like:

-PT1S

I had expected this to be a duration. Can someone explain this formatting to me?

It's ISO 8601 format.

https://www.digi.com/resources/documentation/digidocs/90001437-13/reference/r_iso_8601_duration_format.htm

-PT1S means -1 second. See https://developer.genesys.cloud/routing/routing/estimatedwaittime-v2#special-cases-and-fallback-strategy to understand what that means

Thanks Melissa, I must have missed that.

Do you have a relatively simple way to split that 8601 response out into the separate H, M, S portions?

You can, but it would be easier to do math with the milliseconds value.
ConvertDuration_v2-0.yaml (3.0 KB)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.