- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 10:31 PM
Need a script to delete the bulk data from tables in servicenow ? EX : RITMS, USERS,TEST TICKETS etc..
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 10:39 PM
Hi Karthick,
I hope this post may help you Remove Demo Data from your Instance without submitting an Incident
and you can try this too
Name: Remove All Data from a Table
Type: Background Script.
Table: Specified in the function parameter.
To run this script:
Navigate to System Definition > Scripts - Background.
Change table_name in the script to the name of the table you want to delete all records from.
Script:
doit("table_name");
//for example doit("cmdb_ci");
function doit(table) {
var gr = new GlideRecord(table);
gr.query();
gr.deleteMultiple();
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 10:48 PM
you can also use solution as suggested by Syed, but unfortunately it does not delete attachments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 11:26 PM
This is a manual activity and it takes lot of time.. thats why we are looking for some script to do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2019 02:31 AM
You can follow the below KB for mass deletion.
https://hi.service-now.com/kb_view.do?sysparm_article=KB0717791