Issue with Scheduled Exports

Sathwik1
Tera Expert

We had a scheduled Export export which used to export all the incident table data daily at 6.00 am

so I have unchecked "Appended Timestamp"  so every time new data will replace in the MID Server..

For first time export all the records, but from second time only new records need to export...so this I can do by taking records which are updated last 24hrs...but here my issue is for saturday and sundays records...because in those two days the end users will not take data from the mid server..

so can any one suggest some alternative for this?

1 ACCEPTED SOLUTION

@Sathwik 

Yes if they don't pick it up then they will miss as the file doesn't have timestamp and it will get overridden.

So now you have 3 approaches here

1) Inform them to pick the files on Saturday and Sunday as that is by their requirement that they required daily files to be pushed for records updated in last 24hrs

OR

2) Append timestamp so that file doesn't get overridden

OR

3) Approach 3

a) Don't run your existing Scheduled Data Export on Saturday and Sunday using the Condition script

b) Create fresh Scheduled Data Export and make it run Daily; This would only run on Saturday.

Create fresh export Target for this and create Folder for Saturday Export and give that path

You can handle this via Condition Script.

c) Create fresh Scheduled Data Export and make it run Daily; This would only run on Sunday.

Create fresh export Target for this and create Folder for Sunday Export and give that path

You can handle this via Condition Script.

Easiest approach is 1st or 2nd But check with your client and business team on this

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

29 REPLIES 29

@Ankur Bawiskar 

Client will not accept for 1st approach.. 

we are using almost 10 tables so data will be more high...so I don't want to proceed with 2nd procedure..

so I will proceed with 3rd procedure...but can use please provide me script how to stop schedule export on Saturday and Sunday…

and for Saturday and Sunday I will proceed with what you have mentioned..

but here the issue is almost I am using 10 tables...

so I want to create 10 schedule exports for Saturday and 10 for sunday....so can you please suggest any other alternative? 

Hi,

Since every table is different and you want for saturday and sunday you need to create those many scheduled data export

1 each for each table for saturday and 1 for sunday

Script to allow to run only on weekdays

answer = checkCondition();
function checkCondition(){

var d = new Date();
var dayOfWeek = d.getDay();

// exclude weekends
if(dayOfWeek != 6 && dayOfWeek != 7){

return true;

}

return false;

}

Script to allow only for saturday

answer = checkCondition();

function checkCondition(){

var d = new Date();
var dayOfWeek = d.getDay();

if(dayOfWeek == 6){
return true;
}

return false;
}

Script to allow only for Sunday

answer = checkCondition();

function checkCondition(){

var d = new Date();
var dayOfWeek = d.getDay();

if(dayOfWeek == 7){
return true;
}

return false;
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you @Ankur Bawiskar 

I will try with the above script..but I had a small query...

Where I am using separate schedule for saturday and sunday,..so I am having option to select Saturday and sunday..

Run : Weekly

Day : Saturday/Sunday so I can use that thing right? why again to write script for saturday and sunday?

 

@Sathwik 

that's correct; then no need to script in condition field

For Saturday - Weekly and Select Saturday

For Sunday -  Weekly and Select Sunday

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Sathwik 

Let me know if I have answered your question.

If so, please mark my response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader