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
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
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 NOT_SET 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 NOT_SET 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
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.