Specific time of day as workflow variable

  • 3 November 2021
  • 2 replies
  • 7 views

I am building a workflow that will send out SMS notifications (using 3rd party API) and I want to put a decision point in the workflow to look at the time of day.  If the time of day is between, say, 8am and 5pm CST, I want the workflow to continue, otherwise, I want the workflow to take a different path where it'll just end.  

 

I'm having trouble figuring out how to set up the decision point step to do this?  I'm stumped, as in the date/time operators I just don't see how. 

 

Any thoughts are welcome.

 

Rob

 


2 replies

Hi @rob_n 


 


You can use the DateTime functions/Expressions in the Context Browser. 


Compare the current Datetime (Now) with Add hours of today + 8 for 8 am and + 17 for 5 pm. Timezones will depend on your server settings. 


 


See the screenshots attached for more info. 


 


Regards


Sarel

Thanks.  


 


I believe that would work.


 


After playing around with it, though, I just went ahead and used a SQL Stored Procedure instead.  Seemed like an easier approach to calculate the time difference in SQL.  

Reply