Mark Manders
Giga Patron

You can use a flow and create a custom 'check if in schedule' action. Input as the date to check (current time?) and the schedule you need to check. Then you can use this script as the script step and create a 'true/false' output to let the flow know if you are within the schedule (and if not, don't do whatever it is you want it to do):

(function execute(inputs, outputs) {

  var dt = new GlideDateTime(inputs.dateTime); // get as input from flow, like 'sys_created_on' or whatever you need
  var sched = new GlideSchedule(inputs.schedule.sys_id); // select the schedule you want to check

  if (sched.isInSchedule(dt)){
    outputs.is_in_schedule = true;
  }
  else{
    outputs.is_in_schedule = false;
  }

})(inputs, outputs);


You can also do the same by using a flow variable, but this action makes it reusable in every flow.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark