I have a process that triggers via a queue trigger, it works brilliantly but I would like to put a little time check at the beginning to save a few issues that we occasionally come across.
So for example, the robot checks the current time is between 5:00am and 11:30pm before beginning. How can I do this? Can’t get my head around timespan variables
Let the Bot trigger as per queue trigger make change in logic so that Bot will not pick any queue items when it triggered in other timings not in the range of 5 to 11:30.
Make an if condition where you have logic to retrieve queue item (EX: Get transaction item) and bypass when the time is not within limit by below expression.
datetime.now < DateTime.ParseExact(Var_ststartime1.ToString.Trim,“hh:mm:ss tt”,CultureInfo.InvariantCulture) and datetime.now > DateTime.ParseExact(Var_startime2.ToString.Trim,“hh:mm:ss tt”,CultureInfo.InvariantCulture)
currently using this approach and the robot is stopping the process because its ‘out of hours’ but it’s not its 14:50:00 so it obviously should be continuing