logo

NJP

ServiceNow Introduction to Script Field | ServiceNow Script Field Shortcuts to make development easy

Import · Dec 12, 2022 · video

[Music] hi all and welcome back so in today's tutorial uh we'll be looking into some of this tips entry which a lot of you must be aware and a lot of you must not be aware about okay so this tips and tricks are with respect to the script field you must have seen script scripted everywhere right on business transcript and other things so we'll be looking something which I find fascinating okay probably you will also find it the same way so I will just go to all and I will go to the fixed script okay why fix script easiest way to go to and I will click on new and whenever you go to the any any of this kind of component like fake script business with clientscript so you will see the script component right over here this and you start typing your code whatever you want oh yeah but you don't know some of the features okay hidden features you can see or hidden shortcuts okay which I will be showing today so you must be knowing after macros your Macros so you know where t a r will give you Glide recorder if you do the tab okay but if you see there is on the on the syntax there are a couple of things right so first and the foremost thing is like oh this is for syntax highlighting okay okay or formatting the text for example you have crypto [Music] you have not formatted your text well okay your scripted then you can simply click over here and it will format your code or the shortcut for that is like you can simply to control Tab and it will format the code I'll be showing it then we have format code okay this is syntax Checker sorry this is a format code then we have replaced replace all and all those kind of things find something this step is but there is something called this help and a lot of people must be thinking this help please like it will lead to some document and it will explain what exactly the script it is doing but it is doing more than that so it doesn't give anything it shows Ctrl H click Ctrl H and just try to click Ctrl H and this editor key maps comes up I'm not sure whether you have tried it anytime or not and this shows couple of pretty cool features with respect to script field like if you want to toggle the screen to the full screen okay so you can have control m okay so we'll try couple of them okay so if you want to toggle to the full screen I am over here if I do Ctrl M it will toggle to the full screen if I come back to then you can simply type Ctrl M if you want to start searching something out so you can do control F if you want to find next okay so it's Ctrl G okay there is nothing search okay so that's why if you find previous then it's Ctrl shift p I think control shift G I'm not then for replace okay it's Ctrl e okay you can replace it out you can add a lot of things okay scripting assistance if you want so you must be knowing if we have variable t r equal to Nu slide and if you do control speed then it gives it gives all kind of definition okay so I will give flight date time if you do Ctrl J okay so it will give the definition of that particular function so if I click on this on Ctrl J so it gives what exactly this function is doing okay and you just try you just get the information okay what exactly it's doing at all pretty fascinating right we'll go again back with Ctrl H and as you can see for macros so you must be familiar with couple of macros but you can see a macros type help and hit tab to view the list of macros s isn't it fascinating we've missed this kind of small things so if I go over here okay and if I do help and tab since it gives list of all the syntax macros which are present on this instance so we have talk okay which will be like if I do dog tab so it will create a documentation.js docs format for us okay if you do for tab it will create a follow if we do where share all so it will be creating an example with an R query okay in the similar way info I use a lot a lot so if I give info tab it will give add info message to us whenever you are writing script included so you have to create a methods in the script include say if you do method this is also pretty useful for me method and if you give tab so it will create a description as well as the function signature for you and you can simply start my order and then you can start writing whatever function you want to do okay and here you have if you want to format it out this is not looking good if you want format it out you have to Simply do Ctrl a shift and tab and it will format your code in the desired way it isn't it amazing I found it pretty useful that so I am sharing it with you okay hope you like this tutorial out okay this was a quick tip and trick kind of session okay if you like this out please drop a comment and probably I will create some more some of my personal favorite shortcuts which I used in my day-to-day life till then stay safe stay happy and have a nice day is thank you

View original source

https://www.youtube.com/watch?v=LP1JZayX0CA