Script Dynamic Variable, Time comparison

Any ideas how to do a time comparison in agent scripts.

What I want to do is provide some different script components for the after hour team, specifically for callbacks. So I want just the time value of {{Scripter.Agent Call Start Time}} and compare that against the after hours time, eg a bool of ifElse({{Scripter.Agent Call Start Time}} > 20:00, true, false)
And then set the component visibility to that bool variable.

Since Scripts only have string, number and boolean data types, i'm struggling to figure out how to do this cleanly, or if its even possible. And since its callbacks (specifically callbacks that started before the after hours shift), the script is already set, so i can't just set a different script in architect if after hours,

Any ideas to help me along would be appreciated.

in theory, you might be able to use dynamic variable functions to parse a timestamp as a string. However, as a famous chaotician once said, "your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should." :slight_smile:

A better option might be to use a data action to request a web service of your own design that performs the necessary calculation and returns a simple boolean result that the script can handle.

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