Jump to content

Time logged equation issue


Recommended Posts

Hi,

I'm currently trying to create a path way that automatically notifies a different email and path should a request be logged outside of 09:00- 7:00. The time logged variable is available form the global flow codes, however it does not appear to work using a greater than & less than equation. I assumed maybe its due to the format in which the system records time, however i cannot see this anywhere, as there is no time logged variable in the email templates, only date logged - which also provides time. 

 

The logic of using 'or' defeats the point, but when using 'and', which was the original intention, this proved to fail despite being logged between those times and would reject to the no match field. I attempted to make the opposite in the no match but this also failed. Is there a way to accomplish this?  

 

image.png.fffc35958184622e36c5de935b7e40f0.png

 

image.png.bb8323bdf93e09e4fbb66fb87b711b2f.png

Thank you,

Foley

 

Edited by Foley Coker
removal of extra photo
Link to comment
Share on other sites

Hi Foley,

Time is a character string, so using operators such as < and > won't work for determining if it was before or after a particular time of the day.  With a bit of experimenting, I came up with this.  There is possibly a different and maybe even a better way of doing it, but it seems to work for me.

Step 1: Get Request Info

Using the Get Request Info, you need to get the date/time value for when the request was raised

image.png

Step 2: Convert the date

Using the Integration node for converting the date, you can extract a number value based on the time using Swatch Internet Time.  The Input Format in the screen should should match how the date and time are stored in the logged date field as shown in the screen shot.  The Output format (B) provides a 3 digit number based on Swatch Internet Time.  As this is a number rather than a character string you will be able to use the < and > operators.  
 

image.png

Step 3 Decision Node

Using a decision node you can use the < and > operators on the Swatch Internet Time to see if the time was after 9 or before 7

09:00 (GMT) = 375

19:00 (GMT) = 791

An example for one of your branches using a Custom Expression to check if it was out of hours might be... 

image.png

When selecting the variable be sure to select Integrations->Integration Call->date as underlined in red.  I believe it default to the Last Node->Outcome which won't work.

If you want to test for different times of the day you can find Swatch Internet Time converters with a quick Google search.

Your workflow may look a little like this...

 

image.png

Let me know how you get on.

Regards,

James

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
On 5/29/2019 at 11:23 AM, Foley Coker said:

The time logged variable is available form the global flow codes, however it does not appear to work

@Foley Coker actually it does work, we are using it in the workflow for support requests. The value for the time logged variable is the number of seconds that passed since midnight. So at 9 AM you would have 32,400 and at 5 PM you would have 61,200. So you would need an expression that has time logged < 32400 and > 61200 to account for out of hours.

Therefore you can achieve what you need without necessarily using an integration node but that works too.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...