SN Utils with Arnoud Kooi - Did You Know
[Music] welcome to did you know the series that brings you tips and tools to help you be a more effective servicenow admin and developer now before we begin just a reminder to hit the like and subscribe and share this video thanks what we cover here are in platform and third-party tools that can make your life easier and faster when working on the now platform with me today is arnold gui the author of snutils it's probably the most popular chrome and firefox extension for servicenow developers and it does all kinds of useful stuff that we're about to see in a minute now if you want to hear a little bit more about the history of sn utils have a listen to break point episode number 44 from january 12 2022. i'll have a link in the description for this video but one thing you won't get on that podcast is a live demo which is why we're here today welcome to the show arnold thank you uh chuck great introduction and it's been a while since 12th of january so great to catch up again that it is now i'm going to jump right into it let's start with where people can find snutils no you know what let's back up even more give them a brief overview of what snutils is yeah it's uh it is a a browser extension as you mentioned uh primarily and it has a ton of features and functionalities to make primarily the developer and the admin live easier so from searching a table executing functions that normally would maybe take five steps maybe reducing that to one or two steps so it's really about helping products helping increase productivity for admins and developers but i'm really uh anxious to are i'm really fired up to getting people to show it so we can really show the things and not only talk about oh yeah i'm looking forward to this too so let how about we start out where can they find sn utils it is in all uh major uh browser extension stores uh what do you think how shall i explain or should i just start showing it this is a demo crowd let's show them okay perfect so here i'm sharing my screen and obviously i have it installed for myself but it is available on every major platform so if i search for sn utils then i can either go to the chrome web store or the second link is my personal home page and there i have aggregated all links to all platforms so over here you see that you can download it for multiple versions for chrome for firefox one good thing to note is the on-prem version that is the most asked questions if people have a instance that is not running on surface dashnow.com so either it's on premise or they have their custom url attached to it then you should get go for the on-prem version but normally uh the the youtube the normal for chrome version is recommended and here you see the just the add to brave button so the chrome version will work on every chromium based browser so uh like like brave or yeah opera or what whatever you have so i can my raspberry pi that's pretty cool yeah that could be done they have a version i'm not sure how it would perform but uh always good to give it a try right so now it is already installed but it obviously only works in a servicenow instance so i could i could close this window right now but here i have a window open and when i just go to the home page it is good to have a refresh so i i have now installed it and when i go to my instance i don't immediately see it what i recommend is going to this little icon and that is the same across the chromium browsers and from here pin it so if you pin it then you have it right at hand and i have already reloaded the page so now i should be able to leverage the functionality and i can go for example to the list of tables that loads one time a day all the tables in the instance and from there i can search but that is basically the way to install sn utils all right we've got it installed what are what what are some of the things that somebody would do first with sn utils yeah the first thing to do is really i think the place where i am right now this is particularly useful when you are a new servicenow developer explore uh the tables within your instance for example let's say that i'm new to the surface now hr space and i would really like to know what what tables are involved with hr then i could just start typing hr and when i want to know task related tables of hr i type in hr task and here i get all the uh the rec the tables that match that and from here i could directly navigate to that table i can search if i say if i only want to update it table records for today so click on that and it will open that table so uh and the option i choose was a list only so for now it's just knowing what it is so and when i go to it again here i see again hr task and here i see hey it is the scope i see as well because i picked the advanced advanced will show me the scope and what it extends as well so when i change the text to sn underscore hr then it gives me as a basis all the tables that are in that scope and from there it is really interesting if you're in a new space to explore all the data open a table see maybe the structure of the table and the entity relation diagram it is all available from here so and this is just an example but you can do it with everything in the platform i know for example all the new next experience tables they have a ux underscore in it so if i want to know a bit what's going on behind the scenes as a curious developer this is really a great place to start and explore your journey with sn utils and let it help you to explore the platform so that is something and and and and from there you can really take it uh wherever you want so uh obviously a big thing in as in utils is uh the navigating around so when i say uh that's as i i can easily access my script includes and so on so it's uh really getting started with it i think a good place to start is the the table list so in a few others i've shown them quite some times but slash commands is obviously an important part of of snutils so when i do the slash u thread do a right arrow it searches everyone with the name of fret and when i hit one i can fully keyboard navigate across my instances over here so there are this is really navigating but there are also ways to uh to execute a command for example when i would do a slash lang nl it can change my preferred language to to dutch and because i am dutch let's let's immediately switch it again you can read that a lot better than i can i can read email okay good yeah i'll switch back to uh to english but there are slash commands there are ways to search there are ways to execute commands like for example the pretty well known slash tn that will show all the technical names and since a while that's also available via a double click so if i want to disable it again i can just do a double click so that are ways to execute functions with less commands and the third one is um to to so navigating searching and execute functions i can also do for example when i do a com and i search for a bow tie it will do a search on the community for bow tie and i don't have id what will come up but some techno episodes so and that those are commands and all of this you can there are about 70 if i do a forward slash it shows me that it has around 100 in this instance it comes with i don't know exactly how much but around 80 out of box ones but you can also create your own that's pretty impressive that you've made this extensible yeah so so would it be an idea to deep dive a bit on how you can create your own yes please okay so what i suggest is i'll create an a custom slash command that will open a scope inside the studio application so that will be a few steps before we get to that but first i know when i start typing slash studio this is a scope the scopes are stored in the cisco table so i'm just going to open that and i want to create a custom slash command for that it already gives me a pre-fill link here based on which i could make a custom slash command but i want to make it able that i can immediately add a filter so when i say studio and then a search filter to filter down my my scopes so here you see that i have the availability to add variables and let's just do it because that's probably easier than trying to all explain it dollar zero the name should contain dollar zero or the the scope name should contain dollar zero so or scope contains uh dollar zero so this doesn't get any result but when we leverage this inside of the slash command window we get a updated pre-fill link that contains our current encoded query so when we click that you see it already suggests a hint and it adds some field names over here the the field names shown here are the field the first two column columns in your list that would will make a bit more sense later we need to define our own name so let's name this one studio now when i click save it does a a a preview of the slash command so it now has executed it without any parameter so now it will show all all the the scopes i can add a switch there are a few ones but when i do it do flash cm it adds created by me to the query and when i do a right arrow i will see the slash command created by me i see something with a request so again when i do a right arrow i see i limit it down to two so now when i would open this one i would this is the default behavior i go to the record that of this of this cisco entry but that's not what we are trying to achieve we want to open it inside of studio so again i'm opening the tab and i'm editing my command again in order to achieve that we need to override the target url so instead of going to the record we need to override it and for that we can go to studio and the url over here i'm gonna copy it and i think let's copy the entire url you need to be a bit precise this is a bit error prone this uh this process so let's hope it will work out all but again open in it and fill in the overwrite url and now you see over here that we have a lit the sys id of that current record so let's be a bit precise and remove it i think this should be it and now we should replace this by with a dollar sys uh id right so when we uh when we then click our result it will uh replace the the sys id with the sys id of the returned field so again let's save it and by the way the fields that you show here now you see it in action name and scope that you define here now you see in the preview of the inline results name and scope in this list so now let's just click on on one and maybe i can add that request filter i'm not adding created by me as a parameter so i get a bunch more right now but when i click on the visa request like that i can directly open the the visa request app in in studio so from now on i have this uh this new uh uh slash command available uh for me so yeah uh maybe you can think of your own use cases i i have done this for myself to navigate to a particular process automation in process automation designer but it is really a way to speed up your navigation one thing to keep in mind is is that in order to leverage this in in instead of hitting enter you need to leverage the right arrow to uh to do to navigate to it so uh that is one thing to keep in mind good point um one last thing or another thing that i would really like to point out and i'm gonna switch quickly to to this browser window in in firefox also leveraging uh sp w that's also a built-in slash commands that leverage that that that url override so when i click on my simple list and i could also fully keyboard navigate with it so this is one uh to look out in the out of box ones if you want some an example of how you can build so such a special slash command but besides slash commands that is also still the the visual studio code part that is part of as in utils and here you see that uh the as in utils art adds this little button and i have a fiest code running you can see over here that it's already running and then when i click on this button it will open up another tab that tab that is a proxy between server the service now instance and the visual code environment and what you have just seen that all the fields or all the artifacts that are here uh there are separate fields separate files for each artifact over here and another thing that is being added is a file called test urls and that is a guess that that it does what could be a url of the actual widget so when i click on this command click it will open that widget that i'm currently editing in in in your instance so if is this is not the right url if you are using it in in another page you can add your url over here and the reason to add that url over here that makes sense if i do this this is my server here i'm opening my server script or i believe it's in the client script in this client script there is a limit called 10 or 15 but if i add it to 10 and i hit save then you see that immediately there has been a done a refresh to the to the servicenow instance so this will work with the html the client script the server script every time you hit save and there is a match in the pattern of the urls defined in test urls you don't have to do a manual refresh in particular when you have a dual monitor setup you can just hit save and you immediately see the result when you have hit save and for the for the css it's even cooler i think when i in the css file and i change something in vs code you see that it immediately updates uh in in in the window so the font size when i set it to four then at the fly it is all being updated so uh i think this is a cool way to uh to to develop and and something similar uh you can also do something similar when you add for example a ui page or a client script inside and then you have an option over here that works slightly different people can show see that in my other videos but when you enable this tab every time you get a it receives a safe command it will try to do a refresh of the current tab you have open so now when i would hit save i would expect you see that and this this is not related to each other but when i do a save it will send an refresh command to the to the current tab so that's something also uh that i think that can help you uh move faster and more and enjoyable when you do your widget or your or any other type of scripting mr timesaver cool arnold where can somebody find help for uh snu tales i think uh i'm reachable in as many as channels as possible an official way to uh to um to to give to to make a mention of problems is an issue so you can there are issues that are uh really bugs but also feature requests in the github also has a section for discussions that people can check out on and ask questions so that's also fine another direct way is the the snu tools channel on the sn dev slack so yeah i'm available i'll i'll respond to any channel but i think those two to keep a bit of things centralized are are the best ways to uh to reach out or to to to get help all right any parting words of wisdom you want to leave with people so uh for for for parting uh wisdom i think it's really beneficial if you check out my youtube channel also subscribe to mine and like it and so on for example about script sync i have a lot of resources that cover how you can leverage script sync uh yeah it's really a sub part we tackle today there is a lot more so check out my resources and and a good one is my my twitter channel every time i add something i'm announcing it on on github so keep that keep that keep an eye on that as well you bet there is a lot to learn in here and we've only scratched the surface i've only scratched the surface with this and every time i turn around i learned something new learned a couple new ones just on today's video so thank you very much arnold uh if you dear viewer have any suggestions for a topic for did you know leave a comment in the video or reach out to one of the advocates on linkedin or send us an email we'd love to hear from you thanks for watching bye [Music]
https://www.youtube.com/watch?v=NJzT3HGTHXQ