Queue Conversation with the longest duration Assistance

In that screenshot, it appears you're converting from a string to datetime, but then trying to assign it to a boolean variable. As the error indicates, a datetime is not able to be cast to a value of true or false. You should either change the value of that variable to datetime or provide an expression that evaluates to a boolean.

Thanks Tim, I am not too sure how to get the time difference so that I can make a decision based on how long the oldest call has been waiting in the queue but I am having a go now.

I am a bit stuck. I have got the data action working as per @Jerome.Saint-Marc assistance. Are you able to assist me in creating the expression that will make a decision if the call is longer than 5 mins for example?

What part are you having trouble with? What have you tried so far?

Not sure if this is the correct way but I am currently using substring so that I can get the year, month, day, hour, min, seconds from the oldestTime output and insert them in individual variables to try use them in the DateTimeDiff() function.

Hi @tim.smith

Apologies, but do you know how to convert the output from "2022-06-13T21:35:43.272Z" to the following format 2022, 6, 1, 7, 17, 14, 821000?

Thank you.

Hello,

After your "Call Data Action", on the Success output, you should add a "Decision" block to check if you have calls waiting or not.
If not (Task.callsWaiting equal to 0), the Task.oldestTime would be an empty string - max duration = 0.

Regarding the test on duration:

You can use an "Update Data" block, and add an update statement with a variable of type Duration (e.g. Task.OldestDuration). For this statement, define the value as an expression: DateTimeDiff(GetCurrentDateTimeUtc(), ToDateTime(Task.oldestTime))

You can then use a "Decision" block to compare this to the duration you want - using an Expression like the following to check if the duration is greater than 5 minutes: Task.OldestDuration > MakeDuration(0,0,5,0)
MakeDuration -> day, hour, minute, second

Regards,

1 Like

Hi Jerome,

Thank you very much. This was helpful and it is working as required. Appreciate it.

Kind Regards,
Chris Carr

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