how can we send a Scheduled report excluding weekends?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 03:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 03:56 AM
Hi,
You could select daily and inside conditions you can check the day using
getDayOfWeekLocalTime
and return true only if its weekday.
Mark the comment as a correct answer and helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 04:42 AM
The easiest (and quickest) option would be to set the scheduled job to Daily, check the Conditional field and pop this script in the Condition field:
(function() {
//run on weekdays only
var day = new Date().getDay();
return (day != 6 && day != 7); //not Saturday or Sunday
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 10:40 PM
1] go to the left navigation panel and search scheduled reports
2] click on Conditional checkbox and write below script
function sendReport()
{
var weekEnd=true;
var now = new GlideDateTime();
if(now.getDayOfWeek()>=5)
{
weekEnd=false;
}
return weekEnd;
}
sendReport();
Please, Mark the comment as a correct answer and helpful if it helps.
Thanks,
Regards,
Ashish Dhole
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 07:31 AM
Hi,
I Have Requirment to run the report on 6th business day of every month(excluding weekends and holidays) how can i achieve it .
Anyone can please help me on this.
thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2022 12:44 AM
Hello, may I ask for help if you could provide a script that sends the report during M-F and during business hours only (e.g. 9AM to 6PM)? I've tried all possible options but it seems like the timezone is messed-up in my script. Thanks in advance!