Has anyone attempted a date diff in an agent script?
We are passing a date/time variable from architect into a screen pop/script and then setting the answer date/time in a script. Both of those seem to be working. What we hope to then do is a datediff between those two date/times variables to get a time difference in ms or seconds.
I haven't tested myself but I believe its possible using the dynamic variables. You will need to first convert Dates to Milliseconds using dateToMilliseconds then find the difference and lastly convert to readable format using formatDuration
Thank you Zubair, this indeed seems to be working. REALLY appreciate the assist.
A follow-up that you or someone else may be able to assist with. I'm now simply trying to call a data action from within the script to set a custom attribute so that it can be stored as a Custom Attribute, I continue to get an 'unknown error occurred' when trying it. I've tried calling the data action from a button, on page load, etc and all fail with the dreaded unknown error.
In testing this Genesys Cloud set custom attribute action from Actions, it works perfectly fine.
Do you or anyone else have experience setting a custom attribute via data action from an agent script?
We are passing in {{Scripter.Interaction ID}} and {{Scripter.Customer Participant ID}} along with a string text for the attributeValue.
We are using the following in the Data Action configuration: