logo

NJP

Bulk Update Records without Scripting

Import · Oct 27, 2022 · video

[Music] foreign [Music] it's Justin thank you for watching and welcome to Justin's house today we're looking at data management again but instead of deleting records we're going to update records so let's get started this is going to be a different kind of a use case and what I'm going to start with is going to the base task table right so I'm just going to go task.list if you don't know that there's a record type in service now called task and then a lot of things in servicenow are extended from that task table so if you have incident incident tasks changes problems anything pretty much on any application kind of assigned to you you can get to a view of all of those things by coming in here to the task table and typing in your name I'm going to type in able tutor and you can see the multiple different kinds of task types we'll go ahead and group by that he's got 88 different tasks assigned to him across the different applications so look at here on the left hand side I've got business application request certification evidence requests event tasks risk acceptance right and so my use case here is what if he left and we need to reassign all of these different kind of tasks to somebody else so what I'm going to do is I'm going to right click this header go to data management and update all of them with a preview so this is like the delete all with preview but instead of deleting the records we're just going to change the assign to to someone else instead of able tutor so notice it brings in my condition that I had filtered on so I can see that we're pulling in just the stuff that's assigned to Able and I'm going to change the assigned to field so let's look for that here assigned to and we're going to change it to let's just uh do system administrator for for illustration purposes but potentially if able left we want to resign these tasks to whoever replaces able tutor and now I'm going to go ahead and save that and we'll have a record of the data maintenance record you can see here of updating all the different tasks to and changing that assigned to now what's funny is I'm expecting to see a preview and I don't have a preview like we did on the delete so that's interesting um so I'm going to go ahead and just hit execute now we'll figure out together how this is going to look because I'm not getting a preview to see what's going to be impacted I'm just checking to make sure I don't notice anything uh preview condition okay we got 88 records that we already know because we were just on the task list matching that condition so let's go ahead and hit execute and see what this looks like we get a warning that it's going to update all the records that match that search criteria which is the Ada records we just saw with the preview so I'm going to go ahead and proceed and there's my status of that progress worker actually running that so we'll see how long this takes okay it looks like it finished I'm gonna put over here on next to my head just like we did on the last one how long I actually cut out of that but it's completed so we're going to go check the execution results and we should see I'm hoping something similar to what we saw at the delete records we're going to see all the impacted records or the records that were updated based on the the changes we made this is good sign so I am getting some links around rollback uh so we're gonna be able to view what was impacted so the rollback context and then I do want to actually roll this back even though this is my PDI and it's all demo data not a big deal there so let's go ahead and check view rollback context and I want to see basically what records actually got impacted so there are 280 updates wow so I made a list of 88 tasks but that resulted in 280 upped or records being updated and changes uh incremental data changes to our 507 of them so and it recorded the old value the new value so if you think about things if there's business Rules running when the assign to changes then it's keeping track of what those business rules actually did this is pretty fascinating again I didn't script any of this I'm just clicking on links and changing what I want so let's go back to that list of tasks of things that are assigned to Able should be zero that's right that's right I'm going to go ahead and search now for those that are assigned to system administrator it's probably going to be more than 88 because there were probably tasks already assigned to system administrator but it looks like let's get rid of this group by ungroup and we should get a total count there's 127 things currently assigned to system administrator so let's go ahead and roll it back and we should see able tutor get put back as the um as the assigned to on this so there's my execute rollback and we're just going to type in yes to confirm click OK it's interesting that they make us type in yes on the rollback but they just give us a warning yes or no on the actual execution or the updating and same with the delete job that we did there all right that didn't take very long at all so we'll click close there and that should refresh the page and uh we'll actually get to see what that looks like so it rolled it back I want to go to the task list again and we'll search for tasks assigned to Able and we should be back to the 88 let me ungroup these yeah it's 88 right there at the top I forgot that Tokyo gave us this new summary here on grouping but I'll just ungroup this real quick and we should see we're back to Able tutor being assigned to all those records even though we did a bulk update changing it all to system administrator 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 making bulk updates in servicenow without writing code when without scripting and until next time don't forget to always be learning [Music] [Applause] thank you

View original source

https://www.youtube.com/watch?v=4hFl3wUYgZc