Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Schedule Import Set Table cleanup for one particular table

Peter Williams
Kilo Sage

good day, 

 

i need to schedule a import set table cleanup for one specific table.

The import brings in 400,000+ records each day and i would like to schedule this to be cleaned up right after the import happens.

How do i go about doing this?

3 REPLIES 3

manjusha_
Kilo Sage

@Peter Williams 

 

There is a OOTB scheduled job-Import Set Deleter which deletes entries of import set table created 7 days ago.

You should create seperate scheduled job for clean up of a specific table ,refer OOTB scheduled job.

 

Thanks,

Manjusha Bangale

 

i can see that in the Scheduler Cleanup but its not specific to that table but all import tables in general

How Do i do it for that one table?

 

 

@Peter Williams 

You can create a seperate scheduler to delete records of a particular import set table

Use below script in your scheduled job

var gr = new GlideRecord("import_set_table_name");

gr.query();

gr.deleteMultiple();

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact

Thanks,

Manjusha Bangale