How to identify and remove unused custom tables in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
Hi Team,
Our instance contains several custom tables created over time. We would like to identify unused custom tables and safely remove them to reduce technical debt and improve maintainability.
What is the best approach to:
- Identify tables with no recent activity?
- Check for dependencies such as Business Rules, Flows, Client Scripts, and Integrations?
- Archive data before deletion?
- Remove tables without impacting production functionality?
Any best practices or recommendations would be appreciated.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hey @akash_birada,
Assuming the Data Archiving plugin is active on your instance, here's the sequence I'd run against your four points.
- Usage: pull custom tables from sys_db_object (scope filter, or names starting u_ / x_), then run a GlideAggregate per table for COUNT and MAX(sys_updated_on) to flag anything with zero rows or no recent writes.
- Dependencies: search Business Rules, Client Scripts, UI Policies, ACLs and Flow Designer flows filtered by that table, plus sys_dictionary reference fields pointing back to it, and don't skip Scheduled Jobs and Transform Maps.
- Archiving: create an Archive Rule under System Archiving, run Recalculate Estimate so you know the volume, then let it move rows into ar_<tablename> before you touch the source table.
- Deletion: open the table under System Definition > Tables, click Delete All Records first so cascade rules fire properly, then Delete and confirm.
Don't treat this as a one-time sweep. Put a small dashboard together, row counts and last-updated dates per candidate table, and schedule a report to run monthly emailing that list to whoever owns tech debt. That converts "unused" from a gut call into something you can actually prove over a quarter before anything gets dropped.
Thank you,
Vikram Karety
Octigo Solutions INC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
this is a manual activity where admins can verify if custom table is being used
You can check if any records are gettting created/updated in that custom table
Also you can search using Studio code search if anywhere that custom table is being used in script
Discuss with your customer about this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader