Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  GetQueueEstimatedWaitTime

    Posted 06-05-2025 19:12

    EilidhB | 2022-06-07 10:14:13 UTC | #1

    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


    MelissaBailey | 2022-06-07 14:07:24 UTC | #2

    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


    VaunMcCarthy | 2022-06-23 08:15:12 UTC | #3

    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?


    MelissaBailey | 2022-06-23 14:15:25 UTC | #4

    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


    VaunMcCarthy | 2022-06-24 01:53:16 UTC | #5

    Thanks Melissa, I must have missed that.


    VaunMcCarthy | 2022-06-24 01:57:09 UTC | #6

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


    MelissaBailey | 2022-06-24 20:13:23 UTC | #7

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


    system | 2022-07-25 20:14:05 UTC | #8

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


    This post was migrated from the old Developer Forum.

    ref: 15033