- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 04:46 AM
Hi.
I have multiple tables that need to be cleaned in my current scope. Unfortunately the application repository does not drop these tables even though they are removed in dev.
I want to create a fix script that drops the whole table upon upgrade. How do I go about on doing this? I have tried doing a glide record on sys_db_object but that doesn’t delete the table.
Solved! Go to Solution.
- Labels:
-
Scoped App Development
-
Studio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 12:50 AM
i think dropTable will also delete scoped app table. anyway did you also try with TableUtils script include ? its ootb script include.
var tu = new TableUtils();
tu.dropAndClean('<table name>');
Doc link for further details.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 05:16 AM
Hi there,
Did you try:
gs.dropTable('table_name');
Obviously, be really careful with this!
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 12:36 AM
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 12:50 AM
i think dropTable will also delete scoped app table. anyway did you also try with TableUtils script include ? its ootb script include.
var tu = new TableUtils();
tu.dropAndClean('<table name>');
Doc link for further details.