Legacy Dev Forum Posts

 View Only

Sign Up

Estimated wait time in seconds

  • 1.  Estimated wait time in seconds

    Posted 06-05-2025 19:11

    mahesh_pillai | 2021-09-22 11:14:31 UTC | #1

    Hi,

    From the InQueue flow I wanted to know the estimated wait time for the queue in seconds. But the Call.Estimated wait time only returns the in duration. Is there a way I can get that converted to seconds?

    Regards, Mahesh


    Ullyot_Jim | 2021-09-22 13:06:34 UTC | #2

    Hi @mahesh_pillai ,

    Thanks for the question!

    It's possible to convert a Duration value to milliseconds using the ToInt function in Architect. And from there you can divide by 1000 to get the number seconds. One thing to remember here is that the Call.EstimatedWaitTime variable value might be a NOTSET Duration if the in-queue call flow could not get the estimated wait time at flow runtime so we want to make sure to handle this possibility in an expression. The examples below return 0 if the Call.EstimatedWaitTime value is a NOTSET duration at flow runtime.

    If you want the number of seconds from Call.EstimatedWaitTime as a Decimal value, you can do this:

    If(IsSet(Call.EstimatedWaitTime), ToInt(Call.EstimatedWaitTime) / 1000, 0.0 )

    Or if you wanted the number of seconds as an Integer value, here's an example:

    If(IsSet(Call.EstimatedWaitTime), ToInt(ToInt(Call.EstimatedWaitTime) / 1000), 0 )

    or you can wrap the Decimal value returned by the initial expression above with a ToInt call like this:

    ToInt( If(IsSet(Call.EstimatedWaitTime), ToInt(Call.EstimatedWaitTime) / 1000, 0.0 ) )

    There are multiple ways to do this but as you can see the key here is that initial conversion of the Call.EstimatedWaitTime Duration value to milliseconds using the ToInt function.

    Hope this helps!

    Jim


    mahesh_pillai | 2021-09-23 08:37:59 UTC | #3

    Thanks a ton @Ullyot_Jim . That worked!!!!


    system | 2021-10-24 08:38:07 UTC | #4

    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: 12081