Community Live Stream - Behind the Answers - UI Actions Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] good morning good afternoon good evening wherever you are and wherever you are welcome to the community live stream my name is chuck tomasi from servicenow and i am here on september 21st to talk to you about ui actions but first let's give everybody a minute to check in hey today's topic was brought to you by one of our viewers who happens to be on right now john has written in and said can you tell us about ui actions and it was so big that i had to break it into two parts so this is part one this is some of the basics along with a few tricks that i learned along the way that i want to share with you we were having a wonderful chat just before the show started a number of people show up early and i love covering these topics like something that you go wow chuck ui actions is pretty basic it seems basic but there are a lot of things in there that i must have glossed over or the features came along later as we went through uh various releases because you gotta remember i learned about ui actions over 12 years ago so it's uh the platform has changed a bit since then and i love discovering these new features and bringing them to you let's continue on with our lead in while other people are joining in this show is brought to you by on youtube wherever my gotta hit the right button the youtube but i thought maybe i had a technical issue for a second no it's just my finger on the wrong button youtube at the url you see there go ahead and click like subscribe share you know what to do on youtube turn those notifications on and you will get a notification something like wherever my phone is around here something like that where you will see my smiling face or in this case contemplative thought about questions you asked so i can give you the answers behind the answers that's why it's called behind the answers today youtube is where you can find that and a bunch of other great content on the community channel including mobile and performance analytics and reporting uh we've got special experts that jump in and do series there there's at least half a dozen videos a week not including the two that i do mondays and thursdays 2 p.m utc is where you can find the community live stream on youtube live so if you want to join in live with the chat getting a whole bunch of friendly faces well names anyway i see names going by oh there are some faces in the little teeny circles next to the chat and thank you for joining me if you're watching this later appreciate it just the same we also do this on twitch whoops we also do this on twitch i knew that didn't look right also do this on twitch over at twitch.tv now community hey it's a one-man show i'm doing the buttons the lighting the camera everything so it's amazing any of this works at 7am that's that's the way it goes it's just i'm bringing you information and having a good time doing it so uh community i skip right over wow my my fingers are shifting along as a i'm having a button disability today there's got to be a name for that community is where you ask your questions if you've got something other than ui actions today please post it in the community there's hundreds of thousands of people out there that are able and willing to help would love to help you with your discussion so post that in community.servicenow.com that's what you see behind me and that's where i get a lot of the inspiration for these discussions that we have on the community live stream so join up the discussion there i invite you to do that if you haven't already first search out and make sure that nobody's asked that question before so that you can leverage other people's knowledge the whole discussion thread if it's not there then go ahead and post it in the appropriate sub-community if it's a developer related question post it to the developer community if it's related to reporting go to the reporting and performance analytics lots of individual places that you can find right up here go to communities there's a few of them at the bottom it says all forums oh the title's in the way now the titles aren't playing okay all forums down here and you can find the right information so just a quick primer on the community so that you can get started on there also if you've been on the community for a while don't forget to check out the recommended link which is right there very helpful brings up content based on your previous searches and you know i don't even know what the algorithm is but when i look at this i go wow i could i could really get into just about any of these discussions community is a wonderful place to go another wonderful place to go is the developer portal over at developer.servicenow.com you can find api documentation which we will be looking at today you can get a free personal developer instance to try any of these experiments uh exercises that we cover today you can get free learning plans and blog articles and videos there's a whole bunch of events there's developer meetups happening virtually around the world they're virtually they're not virtually around the world they're ver they are around the world but you get the idea they're all happening virtually right now over at meetup.com you can find those underneath connect and there's an events uh menu in there that also lists webinars that are coming up yada yada so we've got lots of information on that more information about the meetups can be found over at meetup.com pro service servicenow dev program so if you want to start a chapter in your area reach out to us there's a form available i can help you with that and get you onboarded so that you can have a chapter in your area if there's not already one out there there's what 62 chapters right now let's see if we can make that 63 let's say we make it 70 by the end of the year wouldn't that be cool we do have room to grow you can see there's a lot of spots on that globe that don't have a chapter nearby that you could be the chapter organizer great way to get your name out there grow your career develop your brand not a bad way to start just find a host pick a topic i'm happy to join in when the time zones allow so look forward to that i think there's one this week that i'll be attending in vancouver let's take a look at the calendar real quick i want to look uh this is this is the 21st so next week is vancouver october 1st is phoenix coming up after that september 23rd is san diego somehow i miss that 23rd that's wednesday do i have time at noon on wednesday gotta look at my calendar so look for that a lot of great information again it's going to be virtual so dial in zoom is usually what we use uh another event that i'd like to tell you about don't forget creatorcon mark your calendars for october 27th that is our half day workshop and now workshop half day um event it's the it's the event creator con workshops available keynotes uh hands-on labs will be coming out on the 20th so we'll announce that schedule the invites are going on on october 8th what is that about two weeks away not much further than that so watch your mailbox if you've already signed up for knowledge 20 digital experience this past may you'll automatically be enrolled so all you have to do is pick your sessions so lots of great information two main tracks one for our low and no coders we call it the builder track and one for the more experienced people we call it the developer track so we're going to have a keynote and then a couple of tracks and then we'll come back at the end a few hours you got everything you want including some networking time social time it's going to be a wonderful event look for a deeper discussion on the breakpoint podcast get the right screen up there breakpoint podcast with jason mckee coming out this wednesday the what would that be the 23rd so i will have that discussion with jason coming out in just a couple of days it's ready to roll watch your rss feeds go over to bitly slash sn breakdash point and subscribe to the podcast you can find that on apple and stitcher and spotify and now amazon as well so wherever you find your favorite podcast look for break point and it will look more like code than a tennis ball there are tennis ball podcasts out there called break point uh tuesday the 20th of october we've got our next tech now episode so check that out we'll be joined by jaron guess to talk about process automation designer and playbook this is part one of two so october and november are going to be a two-parter look forward to sharing that information with him and learning from him of what you can do we did a little bit of that with live coding happy hour last friday i had some technical issues so apologize about that andrew and brad and we were joined by lisa holdenstein from germany she was able to guide us through a number of those things but go over to bitly tn 80 reg and get that information we will be doing a little bit of scripting today because we will be doing ui actions and they require just a little bit of script for what we're doing those code snippets will be available in the github repo that you see there bitly sn-cls if you are not comfortable with javascript go check out the javascript series i invite you to do what thousands of other people have done to learn more about javascript and learn it on the now platform ah quick tea break while i take care of that thank you to everybody who's watched and made comments and done that kind of thing let's go to my personal developer instance and get started with today's topic ui actions what is a ui action well this is in the pantheon of ways you can make the system do things you can trigger logic to happen on a database action save update read create that kind of thing where you you run some logic based on a database trigger you can schedule a job or a flow to run based on a time daily weekly every three hours you can also do them manually so ui actions are the manual triggers that happen on the screen and you've probably seen them all over the place they're often covered in your basic sysadmin course or implementation specialist course but i'm going to give you my spin on these this is not a replacement for the course material but i would call it an augmentation of that so one of the places you can obviously see this big green button right up here at the top of the screen is a ui action i click it something happens what happens i click it a new empty form comes up possibly with some default values in it okay there are other ones ui actions could be under this menu i have one right now called save they could be if you right click that's the same menu by the way i always like to go here it's easier for people to click than to right click and go where do i right click right click isn't as intuitive so the form menu or the hamburger menu there there are other places you can put ui menu submit is a ui action i said ui menu ui action here you can also you may see them down here as a related link let's go to incident i think incident has some good examples of that so incident let's go to open and there's also a number of them on the list besides this one at the top i could right click a record and here are some archive record assigned to me follow on live feed those all do some manually trigger logic there's also the possibility of putting a button at the bottom don't see this too often occasionally i think it's on slas i can't remember where it was there was something that said activate and deactivate this menu down here is a list of ui actions archive record delete if it's grayed out it's not available for any records you do need i didn't mean to do that you do need to select records for this list action to actually start working if nothing is selected it says well then i'm not going to do anything for you and i'll get into a little bit more about how that works lots and lots of places if i go into this record let me see i think i have a few more ui actions available from the form menu yeah create outage create problem these are all ui actions there's also update resolve delete some of these come out of the box some you can create your own and we'll look at ways that you can create your own today and i thought there were some related links down here repair slas is another one that's down here in the related links section so lots of places you can put ui actions uh under maintain items we see activate you're right that's where it was i knew i saw it it's not a common one so i'll get into some of the the best practices as we go through this let me now that we've had a quick tour of where they are where do you go to build or maintain these well one place is from the form menu let me go to the employee table again or from the list menu you could go from the list menu configure ui actions okay and it will bring up the ui actions for that table and any parent table so if i was on incident and said i want to configure the ui actions i will see task and incident ui actions because remember it's an inherited table it's going to inherit the tasks excuse me it's going to inherit the ui actions for that as well keep that in mind you may see things other than the table that you have in here if you're in a cmdb and you're down a few trees there could be ui actions on uh base tables higher in that hierarchy higher in the hierarchy that's an interesting phrase i'm going to keep it simple today since this is a part one you can also find them in the record itself so if i drill into one of these same thing create or configure ui actions there they are do i have that at the appropriate size yeah 125 is about where i want that i could also since this is a scoped application or now that we're in paris you could do global as well go into studio and configure the ui actions for that you would find those under server development ui actions if there are none you would create under server development there's a ui action or of course type ui action here let's take this approach for the moment i know i could go to the form and say configure ui action i want to create a ui action on my employee table to terminate an employee just make it real easy because i may have employees where let's see is everybody active right now i thought they were from the other day let's make this active true i don't remember where the state went but what i'd like to do is okay went from offered we'll make chuck a full-time employee to remember to hit the state and the active flag and perhaps a date of termination if there's various things that happen it's that's cumbersome to put into work instructions or to try and train people to remember to do it let's put it all in one action and we can make it conditional to only show up when it's appropriate first let's talk about what that action will do we're going to change the state to terminated we're going to change the active field to false that's it and right now these are the labels i don't ever trust labels i don't trust field labels i don't trust table labels i don't trust they may not be true representations of what the value is behind that so if i right click here or go into the table look at the state field i can see what the choices are but right click on the label and say show choice list it looks like they're pretty straightforward if it says recruiting in english it's going to be lowercase recruiting it's all lowercase versions of what the labels are good idea to check that when you're setting a value in script which we will be doing so let's go and create a ui action on our employee table we've got several in here already but none of them is called terminated and i also want to think about where i want to place that on the form i could put it as a button at the top and say terminate if terminate is something you do on a regular basis daily perhaps then this this button row or the one at the bottom of the form also is exactly the same best practice would be these are the things you do all the time saving updating resolving incidents okay they they happen quite frequently they're the most common ui actions you use so it makes sense to put them up there but be cautious because there's only a limited amount of space okay i'll make an excuse create user is not something i do from here it was an exercise on a previous video so don't worry about that terminating i don't feel like it's something that i want to do every day there's another location i i forgot to finish my caution statement there's a limited number of space up here and some people like to put very long labels if it has a very long label it shouldn't go at the top it's going to use up that precious real estate because you don't know if the person is looking at a screen of this dimension or of this dimension okay it may look fine to you the developer who has this ultra wide screen with a high resolution you know plenty of room i can put seven eight nine buttons up there but when it starts to get lower resolution obviously this is an exaggeration but it will start to wrap and you're gonna get crazy things going on with that toolbar so limit the number five maybe six buttons at the most short labels if they have longer labels think about putting them under the form menu okay this is where it might work a little better for secondary actions or a related link if it's a longer context or you want to hover over a hint of what that thing does you could add those there i tend to use more related links related links also kind of make me think of related records so if i need a ui action that's going to do something to relate to records i haven't put in the related links you decide okay there's a couple of guidelines for the form ui actions uh is it just when creating list view button i gotta look at the many times the form button is not shown on ui action form why we'll get into that that's part of the conditions when i look at creating a new that's a great segue actually let me take you in there when i look create a new ui action up comes the ui action form make sure i'm not missing any other questions no i don't see so uh i generally put buttons on the top if it's forward moving action from the process perspective it's moving back in the process that it's relatedly another good guideline you decide for your organization what makes sense to go where you'll you'll start to get a feel when things are wrong okay if it's if the button bar has 16 things on it that's probably wrong so let's call this one terminate i picked the table it's going to work on let me blow that out just a little bit is going to be the employee table fortunately there's only one employee table that i want the order is where it fits in the order if it's a related link it's if it's a button it's horizontally if it's in the menu it's vertically you get the idea do i want this one to come before that one that one come before that one if they're all 100 it's going to be random maybe alphabetic i don't know but i am going to do something a little different since i don't have any related links i'll put that you know what let's make it a button first let's make a button and let's put it at the end be careful if you have a delete action or a cancel action or something that's destructive that you don't put it right next to an update and if you do something destructive you'll want a confirmation on that as well so we'll talk about that in the next in part two of ui actions which is coming up i don't know when because i haven't scheduled it yet but we'll talk about getting that confirmation thing in there some of you may know how to do this great i'll show you the rest of you in a little bit so i want this at the very end and the action name is very important if you have one of those confirmation kind of things i like to put it in as a best practice anyway so i'm going to call this terminate actually you know i'll do the table first terminate it's not needed it's not but it does have a value excuse me it's not needed because i'm not doing a client script but what it does have a value for is if somebody tries to put the same ui action in a number of places it will only represent it on the form in one place so if i call employee terminate in one place that says this is going to do a determination then i try to put it in you know as a button and a related link it's going to go i'm only going to put one on the form so it's a nice safety valve to say why do you have multiple ui actions with the same name that doesn't make sense okay uh is it active yes i want it to work all the time do i want to show this on new records this is a rarity for me i often don't present ui actions because i need the data first to determine what the ui action is going to do in this case i'm not going to terminate a new employee as i'm entering the record what would be the point why would i enter a terminated employee unless of course i was doing legacy records so i'm not going to put it there do i want to show it on update for existing records yes and i believe you know i thought these had some nice hover overs they don't shame on the developer who made this form client we'll get into that confirmation thing in part two i'm not going to talk about overrides i'm going to keep this simple this side over on the right is where i decide where i want to place that i've got a few form options my form button which i decided we will do first the form context menu is that right click or the form menu that you saw or a form link is down in related links the form style is fairly new i think it came out in jakarta istanbul and i can say primary destructive or unstyled default is unstyled which is just gray outline gray box on the button primary is this bright green which you will see for submit and destructive is red cancel delete destroy terminate that sounds like a good one only works on buttons it works on the doesn't have any bearing on links and you can see here's the rest of the list ones they'll go through those in a minute but the banner button was up at the top like the new button the bottom button was down below by the menu there's the context menu where i right click a record the list choice is that drop down list where we saw delete and tag and flag and follow on instagram whatever else uh list choice i can't remember where it is and list link is uh like a related link for the list so messages are going to be much like client script messages field if i need to pass some translatable key to the client portion not using that so i don't care comments terminate an employee i want to be a good citizen and put my comments in here i would also probably put what what is in the state the hint is handy for a hover over so i can put terminate this employee the condition is whether or not this gets back to um who has the question abhishek this gets back to whether or not it should display this ui action i'm going to put in here current dot active simply says if this condition resolves to true again no hint but this condition expression must resolve to true yes i could put something like this i could put a number of things but this alone says is this an a truthy expression i might have other things that say gs dot is interactive okay i can put other bits and pieces in here to say all right somebody has to be at a browser it's a human not an api i don't know how an api would hit this but you get the idea all i want to do is present this for active records if it's a terminated employee active is false it won't show the button i don't need to terminate a terminated employee that doesn't make any sense it also helps limit the number of things that are on the form to make sure they're presented in the right context so that's what the condition does for you and then the script carries out the actual action so for this i'm going to say current.active equals false current.state equals terminated that should be a string the first one should not and current.update now if i leave it like that when it hits the update it's going to do the same thing as if i hit the update button which is bring me back to the list i may not want to go back to the list i may or may not let me show you real quick what happens when i do that little skinny out of that go back to our employee list reload the form so i can get my new ui action there it is big red terminate okay very hard to miss and i currently have chuck tomasi fte active i hit terminate and it goes back to the list notice that i am now false i go back in that record i am in fact terminated and no terminated button shows for a terminate employee because active is false again you may have other conditions to say whether or not this should be presented or not so that ui action is doing great but i want to stay on the form if you want to stay on the form there's one simple thing you do in the script and that is putting here i'm not sure why that went ah too much scrolling get back there action dot set redirect url case is important on this current okay that comes right from the documentation i went over to the developer portal and i don't look up action you'll get like 7 000 results look up set redirect url you get this page right at the top of the apis and you can drill in and it will say here's how you use it this has been expanded in uh recent releases originally we only had a set redirect url and think set return url was another one return url say when i'm done updating don't go back to where you came from go back to where i tell you to come from takes a url or a glide record both of these do says object url no one's missing a parenthesis but uh there's some other things in here i encouraged the docs team to build out the action api a little bit better so fortunately we've got that now just doing my job i put that into this and it doesn't have to go at the end by the way some people think it does it's it doesn't it's not happening after it's actually injecting something into the header of the form to say oh when i'm done go here i could put i've seen this in other places in ui actions it works just fine it's almost like a preload thing so don't be concerned about where that goes let's close update that and load it again let's change our demo data back to fte active this will bring me my terminate button and when i do this it now stays on the form this is one of the most handiest things i do in ui actions i update and stay that's all i want to do so very easy to do now it's more like the save button okay so that's a simple uh shall right-click edit action did that keep button label small minimize the number of buttons continue object yeah so i talked about all those other things for things that are used frequently if you have i'm going to preach this again if your script starts to get rather long consider using a script include and calling that i like to make the scripts in my business rules and the scripts in the ui actions and other scripts as small as possible and put the code that really does the work into the script including the script includes as the brain of your business logic then if i had something that says oh i want to terminate employee from a ui action i just call that script include method if i want to do that from a business rule call descriptive same script include method it just calls terminate employee and it does whatever it needs to do uh we have another question in there list choices after selecting boxes and list view choices look okay yeah we'll get to the list choice good segue because we're going to do that now uh let's create a list action for a course oh stay on the right stay on the right screen here let's go create another one this time i am going to take my cls courses table and you can see i've got no instructors in here when we had an uh an incident and right-click assigned to me it set the assign to field to my user id this is not an assigned to field this is an instructor field has a different name but i want same kind of let's see show instructor it's a reference field assist user same kind of functionality so i don't have to open up every record or go double click chuck oh boy this is getting tedious it's quicker to say right click assign to me right click assign to me okay so let's do that we're going to create a list action to do the assigned to me real fast go to studio create another application you know what uh you know i think i'll stay in here i showed you a couple of different ways you can do it since i'm on a scoped app i like to stay here that way i can build on one screen and test on another one ui action assign here assign make me instructor so we won't confuse it with the other assigned to me table is going to be the course table i'm going to make this called course assign instructor fair enough can't happen on a new record how are you going to get a new record on a list that doesn't make sense let's do this as a list context menu the color is not going to matter the condition do we need a conditional let's look at our data again probably active is true why would you assign an instructor to a false so let's do current.active easy enough and i'm going to put in here current.instructor equals gs.getuserid and if that feels a little foreign to you gs is a glide system getuser id simply says use mysis id as the value that goes into this field current.update this is very much like the form i'm still doing a record at a time and i don't need the action set redirect because it's not going to go anywhere i'm doing this from the list but what i can put in here is gs.add info message and spit out the current dot was it name current.name put in a message that says instructor is now gs.get user display value i'm taking a guess here it's not auto completing for me for whatever reason let's try that i'm going for a memory on that one but we'll put a nice message at the top save that reload our list bit of a shortcut here you don't have to go to this reload refresh list you could just click the filter up here where it says all refreshes the list and i can say take this one there's my make me instructor all right i didn't do the yet info message for whatever reason this is where you go and look at the logs and see did i do something evil and bad and it says yes add info message it says i have no idea what add info i've add info message nice typing there charles nobody caught me on that one so go back here very easy to fix take that out update if it doesn't work look at the logs if it does work look at the logs refresh the list it did the assignment part it just didn't get me the nice status message so make instructor ah security does not allow execution that action against the specified record that's lovely i wonder what that's all about it worked before make me the instructor that one has some acls or something on it and i'm still not getting my message am i still getting an error did i update the get display value is incorrect all right let's go look at what it should really be get name glide system glide system has many things to it and i want yet user display name isn't that what i typed nope is it get user display name because i thought there was a get user display value get user display name okay there is a get user that gets a user object and has some more stuff in it i'm not going to get into that today get user display name let's try that i just want to see the status message before i go on i did not pre-write this script obviously courses all i'm going to run out of courses real fast make me the instructor it doesn't like that one for somewhere some reason make me the instructor it doesn't like any of them security does not allow the execution of that action against the specified record okay let's make you nothing make me the instructor there it is advanced blur constructor is now chucked tomasi we got our message i don't know what's going on with those other records at the moment don't have time to check it out says yeah they like that many times when i try to create a ui action the selection for type lacks form button form link form context uh if it's missing something because i noticed a little while ago one of my instances was missing the form style for whatever reason the form got a little out of whack i don't know if somebody else is monkeying around with your forms an admin is doing a a forum layout or a form design on that go check that they should be there you can always double check in it sounds like a form layout to me because i've seen that before on other forms go into a show xml on any on any of these forms let's see if i can get it this time and you should see every value for every field in there and for example there's your forum section form action false false form button false list action true so you will see that the fields and the values are there they just may not be displayed on the form so take a look at that oh you're right these are not active which is why it won't let me do that on those the ui action is working perfectly but it comes up as some kind of crazy security issue all right if you see that you now know what to do the other thing that i wanted to show you is if you are doing a list action maybe i wanted to do a number of these to assign to me at the same time it works very similar if i change this from a list context menu to a list choice menu that's the one at the bottom let's save that and update let's just change these to nothing there's nothing to say that you know because it's false i can't go in and do a list edit anyway i could still assign that to me it's just the ui action won't let it assign to me at this point let's take that one i wrote the condition and i didn't remember what it did okay refresh this list pink and down here you will see make me the instructor come on zoom in zoom in zoom in while it's okay make me instructor that didn't even get bigger shame on that but it's not lit up it's gray it's disabled until i do something like that which is interesting because one is true and one is false it says make instructor i'll do one of two of those so if you ever see that one of two thing you'll know why and it still works as current dot whatever because it's taking one record at a time i still get my message now there may be a point where you want to create something or you want to create a a a banner or a what they call footer button banner or bottom button not the best terminology but okay if you create a banner button let's go create one real fast on that same table so ui action this is one of those funky little tricks that i don't know if it's documented or not i haven't seen it but i learned it in the community a while ago and call it uh display message we'll put it on the course table we're not going to actually do anything to a record i am going to make a uh list banner button okay we'll take insert off we'll call this course message no condition we'll just do a gs.add info message okay uh display message okay something real simple for our list but there is a missing piece in there that you may not notice at first if i refresh this list there's my new button nice big banner button and i click it and it says no record selected why would i need record selected to display a message or to launch a cleanup script or something that doesn't involve selecting any records if i select a record then it works well that's annoying because this particular action doesn't need a record it's just displaying a message that makes absolutely no sense the way to get around that is to change your action name to start with cis verb okay i don't normally do this because there are many out-of-the-box ui actions in fact if you look under ui actions it's under system definition ui actions and i say show me all of the ui actions where the action name starts with cis verb underscore you will get out of the 1642 about a third of them 449 of them and i'm going to put on that list the action name right after the table okay cis verb new this is for view change this verb updates this verb insert these are reserved words do not use them for your ui action unless of course you want to override whatever the default one does if you don't like the new button and you want to make a new new button you can call it new call it says verb under insert and it will override that ui action says verb delete says verb there some of these i've never even heard of let alone know what they do some are pretty easy to understand insert and content insert and stay there's lots of different ones of these cis verb underscore is a special one and one of the most special ones that i i like is cis verb underscore cancel if you're making ui action and you want to do a save you can do a current.update if the form has mandatory fields that are empty using the action name says ferb under cancel if i've got time i'm going to show that to you we'll save the form without the mandatory fields so it's like a temporary save draft i often use it on a ui action called save draft let's maybe we can do that in a second but cis verb underscore something make it unique make it like you know use your table name whatever it is in there that makes that special and that will allow you to go back to not favorites recent go back to the courses display message now displays without having to select records so now you know how to get around selecting records how do you get around mandatory fields well let's make a field mandatory i thought i had one on here i do not let's say instructor is mandatory and i haven't filled it out yet okay so real quick i'll configure dictionary make it mandatory and of course if i try to save this form it will say you haven't filled out all the mandatory fields you got to go fill out instructor however if i want if i've got a long form and i've seen this on some companies that have very long change request forms for example and there are a lot of fields and they don't know all of the information on that first initial hey i need a change or i'm hiring an employee if you don't have all the information but there are mandatory fields like okay it'll take me two hours to find this out and go fill out the fields i just need to save my work save and continue don't don't kill me we can go in and create a ui action on the course table oops my fault ui action we'll just call this uh save draft let's put that on the course table as we saw before same thing i probably could have done an insert and stay on the other one let's do a form context menu since we haven't done one of those before and it needs a special name cis verb under cancel remember you can only do one action name per form so you can't have a cancel button and a cancel right click action not gonna work i'm going to you know what i do want to use that one on an insert i may be filling out the form for the first time and don't have all the information i'll give that a little cheap exercise and let's just say current dot update action dot set redirect url current okay save it and stay on the page we could even put in gs.add info message these three often go together in my mind that says gs.get message we're going to make this translatable right from the start and put in saved okay i didn't put in a hard literal string that time so proud okay reload the form actually you know what let's go back to the course list create a new one and give it a name um september that's a pretty unimaginative thing we'll call it september and under here i have save and save draft if i try to do save it's going to say you don't have those if i do save draft it does save okay so kind of dangerous if you have things that really need to be regulated and say we must have our mandatory fields but if you've got a form that you want to allow people to save occasionally call it cis verb under cancel and it seems kind of crazy because you're thinking well wouldn't that just cancel the operation no it's a special name so there's your little tip and secret any other questions how do we create context or drop down application menu in navigation panel do we use ui pages or macro in the navigation panel to what abitech you're gonna have to clarify i'm not sure where you're you're looking you're talking about over on the left nav menu so i'm i'm thinking you know there's there's no right click here you either edit the module and it will take you to the module these don't have right click haven't for many many releases so there's there's nothing really to right click on the navigation menu if you're talking about on a list like if i'm looking at incidents and i want to right click let's look at some incidents other than the ones assigned to me go to here this is the did i not leave my instructor oh no i turned it into a turned into a list menu option so these would be ui options here so edit module brings you right to the module that you edit okay there's that's if you wanted to make more of these stars and pencils and stuff that's not something you do okay as far as i know that's not available to customers to do um let's see what is the usage of isolate script in all of the scripting components when isolate script is checked i have seen actions will not be performed that is a very good question i think it's beyond the scope of what we're doing here i don't i don't see isolate script in this is it is it on the form i don't think i've ever used that before let's see if it's in here isolate isolate script false interesting i'm going to have to check into that we'll put that into part two excellent question not something generally used for the beginner as we go through ui actions let me check my notes make sure i covered everything that i want to cover today list options say one of two we did that yeah that brings me to the end all right so ui actions are a great way to set fields trigger actions do things out of a script include that kind of thing and most most are quick to build and easy to debug with some low code operations so you don't need to be this involved computer science to trigger ui action if you need to leverage more complex logic you work with somebody who builds it in a script include and you just call that much like we didn't write current action dot get set redirect uh how do we delete multiple records using pagination that would be done through a script or very carefully you could do that through a fixed script if you needed to that's why deleting records is not really recommended if you're doing that in dev you probably want a dev cleanup script of some type either as a fixed script or something of that nature i generally don't recommend deleting records the the exception for me is always what i'm trying to do an import and it didn't import correctly and i'm going wow this is just complete chaos and i don't want those anymore i need to retest it so i get those records created properly then i have a little script off to the side that i say good go do a delete multiple on this table and away they go you can obviously put in filters in there so join me next time on the 24th in three days on thursday at 2 pm utc for flow designer transform functions this i believe came out in orlando very useful stuff again a way to reduce the need to write script for some of these operations you do on flow designer data pills so we're going back to flow designer we're going to cover the data transform functions little fx on a data pill very useful stuff and then next monday we'll be talking about views and view rules and there again like this i discovered a lot of stuff that i thought i knew but there are so many little nuances to these things that can really help you out if you know how to use them effectively so i look forward to talking to you then until then everybody stay safe and be kind learn something share something and i'll see you next time take care bye [Music] you
Info
Channel: ServiceNow - Now Community
Views: 2,121
Rating: 4.9285712 out of 5
Keywords:
Id: _G8X9bi8spE
Channel Id: undefined
Length: 50min 49sec (3049 seconds)
Published: Mon Sep 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.