How to stop Scheduled Data Exports running on a weekend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 12:59 AM
I've created the following Scheduled Data Export:
I'm wanting to run this job Monday to Friday and not on the weekend. What I've noticed is that when I select Daily as the Run type, it still runs on a weekend.
Does anyone know what I need to do in order to only the run Scheduled Data Export from Monday to Friday and exclude weekends?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 01:27 AM
You can put a scripted condition on it to check on the days of the week (exclude Saturday and Sunday), or use insert&stay and create 5 data export record (one for each week day).
Selecting 'Daily' does just what it says: it runs on every day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 01:54 AM
Hi @Mark Manders For the scripted condition, would I need to set the 'Run' field to Daily, or would I need to clear that field out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 02:10 AM
No, you can keep it on daily, so it will also be triggered on Saturday and Sunday, but because the script than checks on the day, it stops executing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 02:13 AM
Hi @matthew_hughes ,
In the "Scripts" tab of your Scheduled Data Export select the checkbox "Conditional" then in the "Condition" field copy the below code -
var answer = false;
var now = new GlideDateTime();
if(now.getDayOfWeekUTC() !=6 && now.getDayOfWeekUTC() !=7 ) {
answer = true;
}