Scheduled Job to Delete Old Reports

ChrisTreichel
Tera Contributor

Can I use a scheduled job to delete old reports?

We have a lot of users creating reports (+1000 per year) that are used only a few times and abandoned.

I want to write a script that will delete reports once they are not run in 18 months.

Report Statistics will tell me the last time a report was run. 

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ChrisTreichel 

 

Flow designer is easy way to do.

 

LearnNGrowAtul_0-1702497761422.png

 

 

I created for change , you can create for Scheduled job table and Look up records and do for Each, delete record. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

AndersBGS
Tera Patron
Tera Patron

Hi @ChrisTreichel ,

 

You can either utilize flow designer as suggested by @Dr Atul G- LNG, or you can create a scheduled script to look at the last run date in the sys_report. Please note, than some reports maybe only utilized once or twice a year and could still be needed. So you need to be sure of your condition so you don't delete anything my mistake.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

best regards

Anders

 

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ChrisTreichel 

 

Flow designer is easy way to do.

 

LearnNGrowAtul_0-1702497761422.png

 

 

I created for change , you can create for Scheduled job table and Look up records and do for Each, delete record. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

I am see how to delete records in flow... I do not see how to delete reports. 

Hi @Dr Atul G- LNG

 

I have created such a flow, adding in reminders as well for the reports owners before deleting the reports. 

But we want to keep a record of such deleted reports, if someone raises a issue we want to retrieve information about the report, which helps in creating it again. Please advise  

 

Can we archive reports ?

Hi @Harsha Pappala 

 

In this case you need to archive it before hand, before the flow runs.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************