Scheduled Import Cleanup

jared_wentzel
Kilo Contributor

I have a scheduled import running every 15 minutes grabbing information from a csv file via https connection. do I need to add a script on it to clean up the import set table after each time it is run? If so where should I put it, and does anyone have any examples?

1 ACCEPTED SOLUTION

adiddigi
Tera Guru

You can write a Schedule clean up script,



var gr = new GlideRecord("ImportSet_table_name");


gr.query();


gr.deleteMultiple();




.. should work for you.


View solution in original post

4 REPLIES 4

adiddigi
Tera Guru

No, I'm refering to a seperate clean-up intended for this import set table only. since the csv file being imported will be growing every 15 minutes (due to our internal process) and the update set table will be growing every 15 minutes (due to the scheduled import) this single table will become quite large before this weekly clean up you're referring to is ran. I'm thinking more along the lines of a post run script on this scheduled import set to delete all the rows only in this import set table.


adiddigi
Tera Guru

You can write a Schedule clean up script,



var gr = new GlideRecord("ImportSet_table_name");


gr.query();


gr.deleteMultiple();




.. should work for you.


jared_wentzel
Kilo Contributor

Nailed it! Thanks man