Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Estimate Wait time output

    Posted 10-09-2025 10:32
    Hi there,
    We want to offer callback to customers by playing the estimated wait time before triggering the in-queue flow. We are aware of the Get Estimated Wait Time data action, which returns the value in seconds.
     
    We have explored using the GetQueueEstimatedWaitTime and FindQueueEstimatedWaitTime functions, and we believe both return the same EWT. However, we're unsure about the output format of these functions. When we capture the output as a string using the ToString function, we get a value like -PT1S. We understand the negative value is due to the test queue having no waiting calls, so that's not a concern. What we're curious about is the meaning of the character "P" at the beginning-what does it stand for?
     
    Additionally, we found a Genesys blueprint for proactive callback where the Call.EstimatedWaitTime function is used, and its string output appears in the format "T0H1M20S".
     
    So our main question is:
    Do the string outputs of GetQueueEstimatedWaitTime / FindQueueEstimatedWaitTime follow the same format as Call.EstimatedWaitTime when there are actual calls waiting in the queue? If not, what are the differences in their output formats?

    #ArchitectandDesign
    #Routing(ACD/IVR)

    ------------------------------
    Paras Manchanda
    ------------------------------


  • 2.  RE: Estimate Wait time output

    Posted 10-09-2025 11:21

    Hi Paras,

    I am going to move this over to the Genesys Cloud Developer Community as I think the experts there will be better placed to answer this question for you.



    ------------------------------
    Sam Jillard
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------



  • 3.  RE: Estimate Wait time output

    Posted 10-10-2025 06:28

    Hi,

    the output of the EWT functions is a duration. Converting to string gives its ISO 8601 representation (https://en.wikipedia.org/wiki/ISO_8601#Durations).
    You can simply use ToInt() to get the value in milliseconds.



    ------------------------------
    Christian Karpp
    Principal PS Consultant
    ------------------------------



  • 4.  RE: Estimate Wait time output

    Posted 10-10-2025 08:42

    There is an article in the Resource Center that gives a full definition of the Duration format (e.g., -PT1S where P=="period")

    https://help.mypurecloud.com/articles/date-and-time-formats-for-digital-rules/



    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME
    Technical Adoption Champion
    Genesys
    2024 Community Member of the Year
    ------------------------------



  • 5.  RE: Estimate Wait time output

    Posted 10-10-2025 08:45

    And regarding the -1 value, some explanations are provided on this page/section: Special Cases And Fallback Strategy

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 6.  RE: Estimate Wait time output

    Posted 10-13-2025 04:36

    Hi,


    Thank you for your response.


    I was following the Genesys blueprint for proactive callback, where they use the ToString() function to extract the seconds value from the Estimated Wait Time (EWT). This approach seemed a bit complex. Based on your suggestion, I found that using the ToInt() function is much simpler and more straightforward.
    I have one more question regarding the blueprint. They use the following expression to calculate the adjusted EWT and store it in the variable Task.intSeconds:

    ToInt(Task.intSeconds / Call.PositionInQueue * (Call.PositionInQueue + Task.waitingCallbacks))

    Here:

    Task.intSeconds holds the EWT in seconds, derived from Call.EstimatedWaitTime.
    Task.waitingCallbacks represents the number of callbacks currently waiting in the callback queue, retrieved via a data action.

    After this calculation, the blueprint uses a Play Audio block with the expression:
    "Your estimated wait time is approximately " + MakeDuration(0, 0, 0, Task.intSeconds)

    followed by a Collect Input block with the prompt:
    "Press 1 if you would like us to hold your position in the queue and return your call when an agent is nearly available."

    My question is:
    Does this expression take into account the already waiting callbacks when calculating the EWT before offering the callback option?



    ------------------------------
    Paras Manchanda
    ------------------------------