logo

NJP

Bulk Delete Records without Scripting

Import · Oct 26, 2022 · video

[Music] foreign [Music] it's Justin thank you for watching and welcome to Justin's house in this video I'm going to show you a new Tokyo feature that lets you bulk delete records in servicenow without writing scripts yes that's the way we used to do it if you wanted to get rid of a bunch of old records um you've either you know basically wrote fixed scripts or did some kind of programmatic way to get rid of those but with Tokyo we can now do that safely using the UI you don't have to be a programmer you don't have to know JavaScript to actually write that script so let's actually take I've got a list of incidents behind me I'm going to look for all the incidents that were created before this year so basically I'm simulating that we I'm simulating that we really want to purge some records from the system right now incidents yeah you probably wouldn't do this that's probably not a realistic example but think of things like logs or events that you're tracking and stuff like that we'll just see this year here and run that so this was going to give me about 66 records that were created before this year mostly demo data and what you can do what's new in Tokyo is you can right click the header and there's a new Option called data management so I'll highlight right there so you can see it and in this video we're talking about delete with preview so that's a new feature I'm going to go ahead and select that and you're going to see this new data management record that gets created and the whole reason I'm making a video is that's actually pretty cool and what it tells you about what you're going to delete so not only does it bring in that filter condition that I had already put in there it's going to actually let me preview how many records are going to get deleted and how many cascaded records are going to get deleted so if I click preview Cascade it's going to run and kind of preview what all is going to be impacted and we're going to see things like slas impacted CIS other things that are related to an incident that you wouldn't think about but because they are Downstream of that record by deleting the record you need to delete those Downstream items so here we see that's refreshed now we got the screen and just to the left of my head you see oh wow even the story so a story from agile a task SLA it's an impacted Ci's all the incidents that were in our filter the 66 plus some time worked entries are all going to get deleted if we were to do this data management deletion so we've previewed it and I'm going to go ahead now and click on execute because I have one more cool feature to show you that let's say you got everybody's approval you click through the warning you hit proceed and you did everything you're supposed to do and you can watch the progress of it up here at the top on this little progress worker so basically it's running in the background in the page is refreshing kind of checking the status of that progress worker but then um let's let this finish and I'll show you what's cool about this okay everyone it's finished I'm gonna put the time right over here that I edited out of the video it did take a few minutes I want to be transparent with you it was not quick um so there's stuff going on there but let's go ahead and get to the cool parts that I want to show you I can check the execution results or I can go back to the list view of that incident that I was actually deleting but I'm going to go actually look at the execution results and show you how detailed it actually gets and what it deletes um so we're going to see things like you saw in the preview there around stories tasks and stuff like that there's some journal entries now that were added in some actual attachments all that makes sense right attachments on records that you deleted you probably want to get rid of them but what we have now that that delete job is done there are two new links for rollback and view rollback context so it's kind of like the preview and execute that we just saw on the delete job so if we view the rollback context we're basically going to see all of the records that actually got deleted so even though we deleted 66 incidents look at this 716 records were actually affected or impacted by this so now I'm going to go ahead and click the rollback so this is what I was getting it to on the previous screen if you did everything you were supposed to do and then someone came back and said no no bring that stuff back you do got a rollback option hopefully if you've done your planning you don't need to do that and you type in yes here and it's going to run and do that roll back for you and you're going to see the progress as it moves through rolling back that those data changes and flushing the cash cash if it's actually needed so I'll close that now that's a lot faster than the actual delete the delete took some time as you saw on the screen there but that is how you can in Tokyo safely bulk delete records from the table notice I didn't write any scripts there was no code it was all through the UI and it had a safe way to do it now obviously this would be limited to an admin role or someone that you would want doing that but now this is something you can do with no code in the platform and I'm super excited about it I hope you found this video helpful if you did please like Please Subscribe or share it with somebody who you think might be interested in bulk data deletion and servicenow and until next time don't forget to always be learning foreign [Music]

View original source

https://www.youtube.com/watch?v=oi28CjAN-Lw