Community Alums
Not applicable

I thought I'd share with you a handy script which is easily adapted to meet yours or your end users needs when it comes to sending scheduled reports.

In my past experience and I've been guilty of this is if someone requests a daily report which also gets sent out on non working days, people query but inevitably live with it... Or if you're dedicated you have 5 or so scheduled entries set up for different days.

If you use the below script you can control the days of the week it gets sent out (9am is just an example)

find_real_file.png

function checkWeekday(){

var today = new GlideDateTime();
var dayOfWeek = today.getDayOfWeek();
var answer = false;
	
if(dayOfWeek == 1 || dayOfWeek == 2 || dayOfWeek == 3 || dayOfWeek == 4 || dayOfWeek == 5){
//1 - Monday 2 - Tuesday 3 - Wednesday etc... etc...
answer = true;
}
return answer;
}
checkWeekday();

So for example an example if an end user needs a report Monday, Wednesday and Friday this would be 1, 3 and 5.

Comments
Abhi2925
Tera Explorer

@Community Alums This script is not working we are still getting the Scheduled reports , is there is any other things we need to configure, we have only check the conditional checkbox and script

Version history
Last update:
‎01-21-2020 01:48 AM
Updated by:
Community Alums