Automatically Add Checklists to Records
[Music] thank you hey everyone it's Justin thank you for watching and welcome to my house that's Justin's house in this video I want to talk to you about automatically applying checklists to your records and servicenow in this video I'm specifically going to show that on my personal visual task board that I use for making all of my videos and keeping up with the content so you're getting behind the scenes but you're also getting some servicenow goodness I'm just going to open up one of these this happens to be the content record for what I'm recording right now and notice I've got a checklist over here on the right hand side that apparently is triggered by my shortcut for drawing on the screen so that's the checklist you can see I've got several things I need to do there's about 30 things 30 steps that I do to put a video together and um I wanted to automatically apply this I have another video I'll link to it up above where I show or that up above yeah over here um where I show how to automatically apply a tag to a visual task board card and then I made the second leap will line up my checklist because I have to manually add this to everyone so I go up here and I add uh or add a checklist let's pull up a blank one here we go I've got another video I haven't started yet for uh Eaton and notice I have a Content checklist and otterly Allison checklist that's the podcast if you haven't listened to it or watched it you should check it out and I have to apply it to everyone so I don't forget the steps in my process for producing video so I wanted to do it automatically let me show you what that looks like I'm just going to create a new task here and do content task I'm going to give it a short description demo for YouTube and initially it's going to just grab the generic content of one and put that in there so I have no idea where that went um where to go I only see it let's scroll scroll scroll I don't know where that went that did not go anywhere for some reason let's let's down here what could be my complete list demo for YouTube there it is it's in the open section it's not apply to open instead of work in progress okay that was weird but notice right there in the middle the checklist has already been applied that's because of flow rate in the background when that content task got created and went ahead and Associated the list now if I do the same thing listed over here under open since it seems like to be over there I'm going to call this otterly Allison test just like it was a podcast and um that's going to look for that it's going to see that words or the words otterly Allison and instead of doing the other one it's going to put in a different checklist so there's the card right there it's already showing on the screen I don't see the checklist applied yet I hope I did that correctly I hope I wasn't supposed to have podcasts in there nope there you go you can see it 34 items just got added even counted up while I was adding them there um as the flow was adding those items to the checklist and now I have a different checklist that includes all the steps I need to do for a podcast so that is this time saving feature there let me show you how I did that actually before I show you how I did that let's talk about checklists a little bit so there's a couple of things you should know about how checklists are stored in the servicenow platform I'm going to show you first the checklist template so notice I have a template for my content and I have a checklist for utterly owl so those are the two that I'm using all the time the other thing is there are demo stuff and if I go into one of those those have of all the checklist items stored in the Json format so that's pretty handy and no good to know that I can access that just by turning a Json into a complex object so there's the autoly Allison checklist and it has all the steps I need to do now when you assign a checklist to a record in service now it puts it on this table checklist just like these like just like a sound so it automatically creates a record here and links it to that document in this case those are those tasks that I just made and in mind on the flow I have it naming it notice service now it doesn't actually have anything in a name for a lot of these looks like they do for HR I went ahead and said hey this is auto created by the flow add checklist of vtp card I put the date and time on there I just thought that was cleaner than putting it empty right so it creates something in here and then if you look if you open up this you'll see the checklist items that are related to it so checklist underscore item is another table where it adds all those different checklist items from the Json to the so associate with the checklist so it's a checklist table and checklist items is what's there and then you can see the checklist items down below and they all have a name whether they're complete or not when they were completed who completed them and what order they're supposed to display in so the fields that are coming from that Json are the name and the order that's it that's all that's in the Json template in order to populate this so we just need to reproduce that in flow designer and that's exactly what I did so I've got a flow here add checklist of vtb card it's going to trigger when a Content task that's a Justin table is not an out of the box table when a task is created for my content that I'm creating for you all so when that's created it'll go ahead and run this flow I don't need it to run when it's updated and I don't need it to run more than once otherwise I'm going to have checklists that never finished so I just needed to run one time and Associate it with my content so I can check off all the things I need to do then it goes and creates the checklist record right so I'm just going to go ahead and say hey I need a checklist I don't know the items yet because I don't know what kind of task Justin is working on so we just create the checklist record and then I do my check-in to see hey does that contain utterly Allison in the short description if it does we look up the checklist template record for where the name is autumnly Allison checklist and then I have a custom action that's converting that templated Json to a complex object and that's the second thing I want to show you here in flow designer so basically I have a custom action that receives the template's string the Json string as an input and then we have a Json parser step that just puts it in the format so if I kind of change this here you can see it's going to come with an odor a name and all the items and within the items you have one to n number of items in your checklist and each one of those has a name and a number for the order so all you do is make sure that that is dropped in here so we're just grabbing that input from here checklist template as our source data and then I had I copy and pasted the um the if you go back here to the let's see here if I go to the checklist templates otterly Allison techless template I just copied one of these copy and paste it over here into this field this right here you can hit generate Target and it'll generate this object over here and you probably want to look at the object make sure it looks like hey hit exit and that's it we've got our object at the very end of the action I'm going to assign the variable checklist object which is an array of objects I'm going to assign that to what just came out of that step number one for the number of items that came out of that Json template so that's what's happening there it's essentially taking a string of text and turning it into a complex object that flow designer can then Loop through and that's the second part here so once we've converted it that's this step number four then I'm going to Loop through it with a 4 each and I'm going to create the checklist item records for each one of those items each one of those objects in the array of objects that we got from that convert Json to complex object so it's essentially rebuilding the checklist and that's why when you saw when I created it it counted up the number right because it's going through the for loop it's going here's the first one here's the second one here's the third one here's the fourth one here's the fifth one here's the sixth one all right so that's the first part if it's the utterly Allison podcast if it's not the otterly Allison podcast if it's anything else I basically say go look up the generic content checklist name is content checklist do the same thing we're going to convert that template into a complex object from Json and then we're going to Loop through every single one of those and create a checklist item and Associate it with that checklist so if I open up this one here I didn't open up the previous one you can see when I'm creating a checklist item I'm associating the checklist that I created in Step number one that's up here create checklist record so I'm associating with that checklist I'm making sure complete is set to false I'm setting the name to the name field that came back from that complex object and I'm setting the order to the order field super super simple but it saves me a couple of clicks when I'm creating content records in my visual task board and service now so again it's just as easy as adding something to my list we'll go back here to my visual task board showing all of my content tasks viewed by state and just for fun I'm going to create one more so you can see that happen I wish it does I hope it does it live like it did the first time we did it we'll just give it a short description last demo for the U2 and I'll hit submit and we should see it there and I'm just going to highlight it in green there you can see it's building up as I'm talking adding all 29 items to the checklist it's been saving me some steps I hope you found this video helpful if you did please like Please Subscribe or share with somebody who you think might be interested in using servicenow to automate things in service now and until next time don't forget to always be learning thank you [Music]
https://www.youtube.com/watch?v=Hnf5SLmCGKM