NOWCommunity Live Stream - 2019-01-15

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] good morning good afternoon good evening wherever you are and whenever you are welcome to the community live stream my name is Chuck Tomasi I am ServiceNow guys sporting a new bowtie thank you to Andrew from Japan for the very generous gift and I am looking forward to talking to you this is January 15 2009 teen we're already halfway through the month and this is the first episode of the year it has been a busy year off to a busy start and I have a lot of content for you but before I get to that let's go through the pre-roll if you are not already subscribed I recommend you go over to YouTube and just came up on my phone you will get the info broadcast to you turn on your notifications you'll find out when you get there and give me a shout out in the chat love to talk to you love to say hi like Macari and Abdul are doing we have number of people watching live thank you very much and if you're watching this later thank you very much for that as well look forward to keeping in touch with you hey we also do this on Twitch over at the URL you see there there are a couple people go watch there thank you very much for that as well and if you have something beyond just a hello how are you how's the weather in your area for the chat please ask your questions in the community remember to search for an answer first I'll get to those tips in just a minute but I just wanted to encourage you that I generally don't answer questions in the chat that that are better posed in the community because it's very difficult to search for those answers in the YouTube or twitch chat weeks months years later down the road whereas posting it in the community is a very very easy way for people to find that information so just doing one final scan around the various control panels make sure everything is working the audio seems to be working the video seems to be working and people are giving a thumbs up on that thank you very much for the confirmation so go to community community dot service now.com if you are new to the community let me get that up there just a couple of tips that search first there's probably an answer for what you're already asking there may be there's there's like ten years of legacy knowledge out there so search those questions of course the older ones may be a little dated the technologies change the solutions may have changed we've learned some best practices we've learned some bad practices so if it's beyond about five years check it out be concise with your questions if you're asking things like hey can someone explain service now that's a general and very difficult to market as what is the correct answer so narrow down the scope of what you're asking please be concise provide details provide context of what you're trying to do rather than asking a technical question go ahead and ask the technical question can I do X or how do you do Y also include the context of what is the business requirement driving that because if we give you a technical solution it may not be the best solution for what you're looking to do good morning Jim good to see everybody check-in it has been a while so open everybody hangs out for a little while and I have a lot a lot of information that I have been sticking away in notes and hopefully we can get to some of that today so not going to read this entire slide to you you are perfectly capable of reading if you are if you have been around the community for a while consider taking some of these content if you've seen something repeated a question a good question that you you want to turn into a solution a blog article reach out and we can help you do that it's a great way to build your brand be be recognized as a subject matter expert in that area so encourage you to do that we also have the developer community let me get the right screen up there there's the developer portal over at developer.samsung.com barians for learning plans all the scripting api's developer meetup blog articles youtube videos lots of great stuff to get you enabled as a ServiceNow developer so look for that information over at developer one of the other things you can also find over there is about meetups let me get the title up there and go to the - keyboard it's always fun go to the meetup screen where there are currently 50 planning on more we just got a new intern to help us grow this even more 50 chapters worldwide almost 14,000 seats sort of hiding behind the label right they are 14 nother 101 people in well fourteen thousand participants worldwide if there isn't a chapter in your area please reach out to us we'll help you get what started you were on this one there are a number of meetups coming up in the area we've got one on the 18th right here in Phoenix Arizona where I'm located there's one in Las Vegas coming up when its Salt Lake City Dallas Fort Worth good to see on the map Raleigh Durham one of the early chapters that we've had is up and running got another one coming up look at this we've got people scheduled things out March 6 March 7th they're going to be talking about the new mobile studio that's coming out in Madrid by that time of course Madrid will be available in early access should be later this month in January that we've got early access crossing my fingers that's the that's the approximate timeline Madrid of course is coming out in q1 and usually about six weeks before the general availability is early access so do your math it could be anytime between late January late February that we see Madrid starting to show up on those personal developer instances another good reason to go over to developer got service now that come and get your instance good morning Kobe checking-in Happy New Year everybody so look for a chapter in your area there are lots of great meetups coming out arc and on the morning tea it's been a while good but a lot of PTO a lot of time off for I said I didn't take a lot of time off for the holidays but working very hard on getting you more videos more content more information all right after this we go over to other events which you can find over at ServiceNow comm slash events dot html' there's other conferences which I will talk about that may go on in just a second but other events that you can find either by location by date by topic I encourage you to go look at the events page over there and even it's not HTML or just search for events it's near the bottom somewhere on the ServiceNow comm page you'll find that there we also have of course the big conference knowledge coming up May 5th through 9th in Las Vegas look new picture there's John Donahoe and I'm over here on this side so if you haven't been to knowledge before this is several days worth of jam-packed information hands-on labs sessions led by mostly led by customers by you to tell your story about what you've implemented how you've implemented well you but challenges you've encountered and how you've met those what value ServiceNow has brought to you so that it's our best sales vehicle is our customers and you are those people so call for speakers unfortunately closed at this point by mid-january 2019 but if you've consider as your as you're going through your implementations in 2019 that that might be a speaking opportunity for next knowledge so go this year find out what it's about find out what the speakers are talking about go next year and you can be a speaker there so looking forward to that the so I've talked about hands-on labs learn it get your hands on all the latest Madrid stuff there's going to be new things with virtual agent there's going to be new mobile experiences there's going to be new things with flow designer lots of great information I am filling my head right now with lots of good Madrid information for the February technology in just a moment I need we need to we need to get to January 29th where we've got the the tech now for mid servers I'll get that in just a second but sign up go over to knowledge dot service now.com learn more about knowledge and what it's all about what you can get out of it great networking opportunity if you are going with the team here's my tip if you're going with a team of people from your organization split up go to different sessions so you can maximize your your coverage at the conference even when you sit at a meal you go to lunch you go to breakfast don't sit together regroup at the end of the day or regroup at the end of the week and find out what each other has done you will meet more people you will get more experience you will you really cover more ground by splitting up if you sit together in every session you're all going to absorb basically the same information so make a plan split up that's that's my one key if you want to get the most out of the conference in terms of networking opportunities we also still have this customer Success Center new material showing up there all the time at ServiceNow comm slash success wherever you are on your ServiceNow journey go in and check it out because you may be just implementing a CMDB for the first time and want to know the best practices there or you may have been doing this for 10 years like I have and find out what the best practices are on upgrades how can we leverage automated test framework to get you to that next release quicker and easier lots of great information on all aspects of the platform and again more information coming all the time so encourage you to look at that I mentioned the technology this as 2013 we've got coming up episode 60 that's right Craig step is going to show us all about mid servers get you introduced to that and and show you what a mid server can do the basics of setting one up they are very very powerful devices for getting information in your into the ServiceNow ecosystem whether it is users customers devices from a sequel database from a file transfer from an SNMP query whatever it is in your organization that you want to bring into ServiceNow I encourage you to watch this if you're interested in learning more about mid servers go register the link is there at the bottom bitly slash T n60 re G for registration Marty Carolyn good to see you feel like the the crew is back on board we also have was I got to get my keystrokes right here any script that I write today will be available in the github repo that you see there I will also be posting a a link in the description at the bottom of the YouTube video I believe that will be right there somewhere and including that in the community as well so it will take you right to the folder don't know what we're going to write today if anything at all this link will take you to the top folder for scripts you've written in the past that way you can download them test them break them make them your own do what you want with them explore and go oh that's what it says rather than squinting at the screen on your mobile device and saying I can't read that script it's too fuzzy I'll try to keep the font as large as possible but also make this available for you online okay that takes us through all of that let's get on with the game it's not a game I think it's a game feels like a game to me otherwise why would there be points okay refresh this got one thing in the inbox is indicated up here with my little red indicator this is our community again community dot service now comms is your first time watching the video thank you very much for joining I like to start out my morning by going to a fresh new list and going to the unrep lied section see what's and you see what's interesting what has just come in hot off the newswire querying the template table IT Service Management my specialty if I'm skipping over these it's not because I don't like you it's because I may not be able to offer any information in there I may go explore this is all about learning I learn as much as I share on this probably learn twice as much as there on the community but if I'm not going into a specific topic its it's usually because that's not where my area of expertise is I am around the platform custom applications and integration so that's where you'll see me poking around if your expertise is elsewhere I encourage you to dig in have some fun so we've got IT Service Management open that up good day could someone spot what is wrong with this code it won't pass the wild condition however the row count is one they're going into sis template they're querying for a society they're adding the query table change request and then they're doing a query does the get the row count one and it doesn't go in interesting if we're getting the SIS ID why do you need the table you're already getting a single record so I would rewrite this let me copy that down get the V on var there we go over to the text editor paste that in so I can clean that up a little bit should be a tab right there this is Microsoft Visual Studio code that I'm using and I like the dark theme on this if we're there's a couple of things that I clear up on this first so we are doing a glide record query if you haven't done any scripting before this is our basic API to get into the database and query records get records and they're trying to get one record and we do this with the add query method and the sis ID is the unique identifier sometimes called a guittar global unique identifier that helps us identify a record in the system good morning Omar from San Antonio let's see now there's a shortcut to this rather than doing an ad query on society we could just do AG gr get on that same society we've also got smart quotes going on the turn that off no he could see it but I can certainly see it normally the quotes on this editor would be straight up and straight down and you see these are a little tilted which means they probably edited it in a different editor gr get is a shorthand notation of doing this and because we've already got that unique record this query is really redundant there's not multiple records and then we say oh and get the one that's on change request table so this gets the record really replacing all three of these in this situation and we don't need the while because we can say if you get this and it returns the thing then let's do this put it in that there is a shorthand notation of doing the same thing so I'm going to rear antenna little code block one line down somebody who is not narrating and explaining is probably going a lot faster than me but this can be shortened to the script below you are already getting the record OOP try that again the record a little bigger so you can read it the record by sis ID so the table is not needed this idea is unique and gets only one record oh let's make sure the smart quotes aren't down there okay these please look good I also noted you had smart quotes on in the SIS ID query I have removed those I have removed those and you should be good now try it and let me know they didn't first coin of the year that was a bell that's the coin let's get this right I think you're only querying one row because you're using the society versus temple table of society's unique identify on the row yes it won't pass the wild condition however the row count is one it's saying I've got one row count but it should get in here if the query is right but it could be blowing up on the query again smart quotes we'll go with that all right what else need help create a copy custom table to be able copying an existing ticket to create a new one let's see we've got here how can I create a UI action which should copy the content of an existing ticket and create a new one in the same table example copy service request you action should create exactly the same service request look at Doc's copy incident or create child incident all right I'm going to give a code example here let's say this is the UI action script copy the current record to a new one would be let's do a new record equals here let's just do new glide record new gr equals new glide record on whatever table your table here I don't care what it is it doesn't matter and then you can do new gr a dot new record some people will use initialize I prefer new record because new record sets default values initialized is not if you read the documentation I really don't know what the point of initialize is because it just says it allocates space well you know fine I thought that's what instantiating a nuclide record does but anyway I'm not gonna argue that I just know that new record sets default values set field values here from current example new gr dot short description equals current dr. short description now there is another way you can do this actually I'm gonna I'm gonna give them a cooler way to do this array of fields to copy this will make it a little more maintainable our field list equals and then put in your fields here short description let's make it a little easier to read with some additional line breaks in here short description description you get the idea priority modify as needed update the table name just trying to make this as clear as possible okay so once we've got a list of fields then we can do this for VAR i equals 0 I less than field list length start not to be a good morning isn't it and take new gr dot set value and we want to set the value of let's do this so let's get the field name I just like burning this makes it a little easier to read field name equals field list sub i we want to set field name to current get value field name hahaha okay take that apart let's break it down current dot get value field name is going to get the value of short description first as it goes through this loop it says get the value of short description and whatever you get out of that use that as the argument as to set the value of short description in new gr short description so new gr short description will be set to the value of whatever current is then new gr dot insert to create your new record create the record let's put come in here copy the field values from current to new gr create the record and then action got set redirect URL probably want to go to the record which is going to be new g r ha you like them apples okay here's a generic way to do it modify the table and fields as needed code thingy pasty pasty done coin that was fun there you go hopefully those understood I will save that off to the github repo so you can follow along anybody see anything James says can't you just re insert the current record maybe I'm reluctant to do that because glide records are pointers and if you reinsert current are you going to get all the current values you may not want all of the values I don't want the number to be replicated I definitely don't want the society to be replicated which brings me to a topic that was in my notes about societies because somebody asked can you set the sis ID of a record once the record is created the answer is no you cannot set the society because you know but it is what it is it's a unique identifier and if other records were referencing that switching that would be chaos to the system however when you create a record you can set the Society didn't know this till I started playing around let's do a real quick test I think I still have on my developer instance a dummy table that I called CLS Chuck with some records in it and if I look closely one of these records may in fact have nope don't know all right those are tasks I think I want the items let me look know as it repairs yes it was repairs okay there it is alright if I create a new record via script let me do this via script I gotta get the right table name here copy URL paste I just need the table name alright bar what did I call it prepare gr equals new Glide record alright spell it right and I say a rep g r dot sis ID equals mmm I already used food let's use bar you can't actually do this I don't recommend it I do not recommend doing this I don't know why I'm even trying it but the answer is yes you can set this when you create a new record let's let's actually do this rep gr dot new record follow good practice and initialize our record rep gr I don't remember what the field was category okay are there other fields on this thing probably not it's just a choice list we can do whatever we want category equals bar okay this will be our chiara insert if I run this in scripts background right there let's get to the right scope CLS run that it inserted a record and if you look closely at the CLS repairs there's my bar record copy society that's the society you can actually set that now if I wanted to try and get that bar to gr equals new glide record Lissa's copy and paste this part I don't know why I'm bothering to type it again put a two in there and try to get that rep to gr dot yet bar do-do-do-do-do we'll just verify that we've got this by saying sis ID equals rep 2g r dot sis ID and try to set it to something else 2g our society equals nu bar rep to gr update and we probably will not get anywhere with that but I would love to be made a liar because that's when you go hey that's strange ou can't do that in global go to CL CLS scope run it again and it says your current society is bar no records updated notice at the top it does not say anything about record updated because it did not update anything the one that says bar is still has a society of bar so you can't change a society that would be really really bad if I were to create another record with the same bar try and do this it should give me an error that says no somebody already has that one come on scripts background wake up wake up yeah it says no you can't do this you need key violation detected for bar key primary that says the primary key for this record is the society you just tried create another record if I can't resolve societies then what could is it so that's a database layer construct that says this is a unique thing I tried to insert this my sequel said up yours buddy it's not happening today so that's what that means now if you were running this in a script and you ran into that how would you fix that you would obviously put a try-catch around that you could put all this goodness in a try-catch you do to you doo doo doo doo I'm gonna take this part out just because that's not gonna work anyway try catch e and then you can always do just dot error o e dot message it should give me my my it did not catch that interesting Wow I honestly thought it would okay well I was interesting hmm I figure that one out so there's your example for today that was a question that was asked over the holidays or whenever I was out though anything else that's interesting in here before we move on wrote a couple of scripts didn't expect that today let me go to my notes I got an email from Roger Sekar I hope I said that close ly enough and he says big fan of you I watched all your videos on YouTube thank you very much that are related to service now best of all the tech shorts playlist I like every video in the playlist everybody otech so doc could you please post I add more videos to the playlist to help me understand and learn tips and techniques and service now that playlist has probably run its course I don't know that we'll be putting more in there maybe maybe there's new capabilities coming all the time for a tool agent may fit in there quite nicely I need one more help I'm finding a little difficult to understand state and active fields I have created a new application by sending the task cable very nice it's a good way to do it I have modified the choices in the state field now I'm facing an issue with my business rules and workflows that are based on the state field there would be a great help if you could please explain to me or post a video of how to override the existing business rules on task table that are related to the state and active fields i found an exact topic on the community and the below URL but i'm not under sure i understand okay the the best idea when managing active fields is not to override the business rules but override the field values that it pays attention to so let me take you to the wayback machine which i had a sound effect for that maybe [Music] let's write that okay imagine it's 2008 or 2010 and you are using ServiceNow and making an application I will go to these tabs aren't in my usual order and I go to the tasks table in task we obviously have a table called a field called state so if I configure the table on the task table I get my usual 66 or 67 fields close that for just a little bit so we can see a little bit more we've got our 67 fields one of which is called of course state state has a bunch of choices and some of them for whatever reason I don't know the history on this and I am going to find out one of these days State on the the choice field on task state is a numeric value now when you create a choice field it's generally a string value if it's labeled approval it has a value of approval sometimes lowercase for whatever reason the choices on state have numeric values it's an integer field it started life as an integer I think I haven't followed up on this I think the logic there was so somebody could say if the value is greater than this we'll do some logic at the values less than that if the value is between here and there you could do something like that but it generally doesn't happen that way and because the choices are different on incident and problem a change it's hard to make a task based business rule that works generically across that so what happened is however I can group these I don't think I can group on a related list no what happened is where's the table on this one I'm going to add table in here the default task states I just want to add table to this related list and search for tasks there we are okay these are the ones you generally may be familiar with and there are three that are special three four and seven close complete closing complete and close skip if it is one of those there is a business rule that says if it's three four or seven if it changes to three four or seven set the active field to false otherwise leave it alone so the active field defaults are true and when it changes to one of these now those numbers used to be hard-coded into business rules all over the place and woe be to the admin who wanted to use a different value they'd have to make their business related to disable the out of box business rule well we got wise to this and said let's make this a little more configurable for you and this is what the the article says in the community it's it's it's all about managing these states so close complete does three closed and complete is for close skipped is seven if you don't change us if you just want to real able those is cancelled closed done whatever you have no more work to do this will work fine you can use any other values 12:20 552 you can use those those will not change or impact the state of the active field because they're not three four seven but if you want to set up your own system maybe 101 102 and 103 are your values for something that is closed maybe you only have one maybe it's 1000 you can change those by adding dictionary attributes you can add a dictionary override which is what this says down here in your custom table so I have in one of my tables let's go back to my CLS I think I had a task table in there items item task item tasks for work and configure the table here now I have a state field because it's inherited from tasks how do I know that because I just little large on that one because if I look up here Oh extends table item let me go to item and configure that I need something that can figure tasks sorry I didn't practice this demo that is not extending tasks very interesting I don't think this does it well the Chuck table has tasks as a prefect so I'm going to guess this one may in fact extend tasks it does okay so let's let's work on this on my Chuck table this is exactly why I built this application so I can beat it with a hammer then not break anything else in here I have my state field and my state field does not I don't believe I configured any choice values for this so in here let's look and see if table contains Chuck I don't have any state values I probably could have easily checked it just by opening the state field yeah these are still the default out a box can't inherited from task values let's go and configure some new ones configure choices now I can either configure choices here I go to the form designer I'm not in the right scope just probably change that there we are these are the ones and they are black text they are part of task that's what this little color code up here tells you it says see all the blue entries no I don't see any blue entries those belong to your table so let's go and create another one let's say start will have a numeric value of 100 apply to table Chuck had that it's not blue because it's not saved yet I'll show you that in a second and end will have a value of 200 add that save it now maybe I don't want the other ones but their start and end I can even let's go back to configure choices now of course they're blue because it to apply the style let's take all of these out and go you know what task I don't want anything to do with you this is my Chuck process I am going to use start and end start is active and is not but I still want that business rule that automatically sets the active field to work when I get to end so this is 100 200 save that my state field of course says open because that's the current state that it's in and changing this to start at end right now will not impact active you can see right here active is still true but I would like it to Oh without writing a new business rule without writing script what I do is go to configure dictionary on here back to my dictionary entry and you notice because I'm in the CLS scope none of this which belongs to global because it's the task table it prevents me from accidentally saying hey let's go change a bunch of dictionary attributes so let's go change a bunch of stuff on task state and impacting everybody in incident and project tasks and everybody who's using a global task table would not good okay down here under dictionary overrides I can first let's see if I have one for my table I do not so let's create a new entry a new entry for my Chuck table and you can see up here there's some information that says here are the current values in here that default value is one if you were just to take task State this is what you get good I would like to override some of those you want to override a reference qualifier no it's not a reference field do you want override the dependent yeah the attributes mm-hmm yes that's what I'm after what attributes do you override so this field has a few that it's watching for and if you look in the product documentation for dictionary attributes do you do that true feud spell that correctly I get a number of them you could add an attribute and there is a long list down here in the C's cccccc section there is close States and what's the other one that I'm looking for I'm gonna look at this article default close state alright so back on that extreme there's close States it says in active state integer values used by the task state util API that's what that business rule that used to have three four and seven hard-coded into it now says hey go out and check are they using the default state values of three four and seven or have they specified some dictionary overrides on their state field to use different values that's what I'm going to do so I don't need to change that script that modify that that manages the active field I just modify these dictionary attributes if you've extended your own table you were perfectly capable of doing this yourself create a dictionary override put these attributes in there's also one which said default closed State used by task state YouTube identifies the default closed state for the test for a task table now in my case this would be a little redundant but since I only have start and end and is the only one but I'll put them both in I want to say closed States if I had more than one I probably should have put more than one in for a good example is 200 who if I had more than one I would separate them by semicolons again this articles are great reference for this because you can see close States equals seven eight nine I could be two hundred three hundred ten hundred ten hundred one thousand and default close state is going to be five I would have expected default close state to be one of these not my example it's still a good article doesn't have to be apparently so close to eight 200 but I'm separating the attributes by a comma so then I say default close state note that the one of them is plural one of them is not don't get those confused read your documentation default clothes state and clothes states this one does not have any semicolon delimited things so again a bit redundant for this example we're going to test it out oh I probably should override the default value - let's go back down there and do this where is my table that I just added CLS Chuck override the default value of default value from tasks is 1 which means absolutely nothing to my table I don't use 1 so let's override that and say mine is going to be 100 and there are various other attributes you can override maybe I want to make my state field read-only that dictionary overrides are a wonderful thing there was a time when I was a customer they didn't exist and it was very frustrating lots and lots of scripting I'll leave it there ok going back to my task field here I am now on start if I create a new record it will default to start as I told it to if it didn't this would show up as one and let's create bonus criminal record there's nothing mandatory required here I don't even have a short description do I I got nothing oh here we go test record of dictionary attributes save that active is still true crossing the fingers as it creates this record and we wait and we take a drink yum yum yum ok active is true now here's the here's the part that I'm gonna cross the fingers one more time if I set it to end and save this active is now false hey I have just changed the rules of the game without writing any script this is a configurable option to say these are my active these are my close States so anything that is not in this list is going to not impact active now if I change it back there's the real question it turns it on hurray the reverse is true I don't have to write a reverse business rule so I'm all about not doing more visit more scripting good afternoon garden didn't see you hiding out there yeah if you haven't subscribed to Goran YouTube channel do so he's got some wonderful videos cranking them out like crazy it's a madman hopefully we will see you at knowledge sneaking in is it is it against the rules to watch my videos we had a few more minutes let's see what else was on the notes that was that was a good one so that is my answer I will respond back to Mr Colley or mr. Rajesh Roger second Sekar sorry about that and let him know we're that we mentioned this so we talked about task state attributes tada the other one that came up is I saw this in a thread using a UI action to open a record with fields populated and they said now if I were to go into the incident table and let's say I take this incident and use the UI action create problem I think in their example they had change requests but it's the same thing it creates the problem record and takes you there and it's already saved hmm the record is created I said I don't want to create it I want to put the form up there and let them modify it because there may be mandatory fields that I need them to fill out but this has already been set created and know if you want to make the person save it for the first time not generate this record this number ID you can do something a little different this is it's still using first let's take that the UI action apart that we just used so let's go to configure UI actions I want to show you what the current UI action is doing for create problem here's create problem if you haven't looked at this this is always fun take a look at existing UI actions and I copy that over here for display purposes only it does a glide record on problem sets the short description sets the CI all of this is from problem from current into problem so it does a CI impact urgency priority company sis domain in case you want domain separated that's the extent of that that is very very similar to what we just did over here only I used an array to copy it rather than explicitly list out the fields that's exactly why I did that so I knew this is gonna be coming up here is where they create a record just like we created a record they get back a sis ID and their problem record now contains this they get back the society and the reason they create the record is so there's now a link because they're updating current they should have updated you there it is that big current so you want to create the problem over here and link it to the current incident to say this incident is linked to this problem if you don't create the record first you can't create that link there's no sis ID to link to that's the whole problem there their question is how do I simply create the record which you can do but you know I'm sorry not create the record but put up the form but you can't create the link back so this part down here is going to have no bearing because you don't have us this idea to link to I'm going to show you a way to create that new record without saving it and ignore the fact that you won't have any link back to the other record your reference field won't be populated so let's say I want to take this exact same piece of logic and rewrite it where going to create the problem without that link and without saving it so I don't need to create this I don't need a glide record object what I do need is to create an encoded query string this is where it gets a little crazy but can be done let's call this variable encoded query string and the encoded query string is used in a number of places probably most commonly seen and used in a list give you a quick background on encoded query strings if you create a filter let's go to incident and real quickly create one by saying so matching critical filter out in progress you get this breadcrumb up here I can copy the query out of there into the clipboard and it's going to look something like here's an example query string field equals blah OOP carrot field equals value up carrot field equals value and then I've got this or state equals null now this is part of a very strange query thing around these choice fields or numeric choice field where null is not the same as not to I think it's in there for like extra insurance it doesn't always work if you leave that off so if you're writing your own query strings be aware of that I can use that same thing to populate values into a form so using that example let's just try something real simple I'm going to comment out all of this from here to here leave this reference code intact let me just take this make that a string and I'll bet I'm going to show you a neat little trick I can say URL equals incident do sis ID equals -1 this part says go to the incident forum and since there is no record sis ID equals minus 1 says create me a new record this is the way to say hey if I'm gonna do this from the URL this is how I'm going to create the new record and sis parm underscore query equals EQ STR that's going to populate those fields with those values and if I use action not set redirect URL believe that's uppercase to this URL string note that action set redirect URL can take a string or it can take a glide record it's pretty smart it knows either one in this case I'm using it as a string so let's just take these three here create a new UI action on you know incident sounds good configure can I try that again for a dollar UI actions make a new UI action I mean CLS I don't want to be in CLS I want to be in Global create a new record we'll just call this my new incident maker and I'm gonna make a forum link just for the fun of it on the incident table let's leave that alone for best practice put in an action name never know when you're gonna need it but it's better to have it than not do so on insert or whatever that's not going to matter no conditions to this and there's my three lines of code set up my query string set up the URL yes I could have done this all in one I just wanted to do it to show you what's going on here my mouse is starting to go crazy and I don't know why it's something to do with my desk and I have my new UI action back to an incident open up an incident I should have a form linked down here my new incident maker and when I click that I have a new record now I did generate a number because auto number generating is on if you click the new button from the list there's a property if you don't want to do that but note that the did it set what I said it said anything what did I tell it to set anyway activists true priorities one state is not equal true that doesn't make sense I'm sorry let's make state equal to we can't set the priority because that's driven by impact and urgency let's say impact equals to whatever what is a default three and three anybody pick that up urgency equals two just to be different we don't even need active vehicles true because that's a default value let's say a short description equals created from form link up carrot up carrot top carrot okay give me that like yeah it's gonna modify our UI actions live coding it's a wonderful thing I should have really checked those parameters before I used them let's see what's been modified elite Li to bring my new UI action to the top of the list and we're getting up to the top of the hour I want to see this finish there's so much more I want to talk about today I could make this a Gary log show but that'll save some for tomorrow lots to talk about one more quick test create that go into my incident and this is going to the incident record so I'm creating an incident from another incident which is kind of silly so the short description series can't log in to s ap on my laptop today new incident maker 2 & 2 that's what I said for the impact and urgency created from for link form link there's the short description so it hasn't been saved note that I have the submit button this record has not been created yet which means I don't have a society and I can't link it back to the other incident or any other record for that matter until I save which it's gonna get a little crazy but somebody who just wanted to know can you create another record from another record without saving yes if you use sis perm query if you wanted to make this a little more variable and use values of course you could always jump in here and start modifying this script and say a short description equals current dot short description plus something like that and continue writing your code naughty blah blah blah okay take the current value for impact or urgency or just keep sticking and current dot something current out something current on something so this way creates a record first so you can use the society this way simply sets up a URL presents the forum with those populated sis Parminder query is the piece that makes that happen this part right there so you can pre populate those fields handy this is actually how templates work so it does something similar at a scripting level it's a little bit different trying to remember what the I think the method the glide record method is applying coded query is something else you may want to look into but that's a story for another time all right let me take this out well we got quite a few scripts here I'm gonna have to save these don't need that don't need that we'll add a comment in here so we figured out later create a record no don't create the record present present form with some pre-populated values and [Music] let the user save because they may back out they may not want that this one described what I did no this one was create your own sis ID for demonstration purposes only don't do this kids unless you really want to go write your own society generator but I can't think of why that one's documented - this one is use the get method to get a single record from the SIS template all right enough housekeeping I am done let's give the old high five mmm good job and I look forward to that's he didn't change the priority though will it do that when you say priority you know I didn't notice that Gordon I did not notice that oh yeah if I was said to planning if you change it yes so for whatever reason the it's not about policy the data lookup that's doing that is not triggered onload that's fascinating I didn't know that that was the case onload thought data policies did work that way maybe it's something to do with the data policy or the data lookup mm-hmm priority lookup rules now you got me wanting to look this up there's the rules it's going to be under data lookup to look up definitions priority lookup says run on change run on insert run an update that's interesting yes a will definitely will do it on save because it says run on insert and run on update but run on form change apparently doesn't recognize on load is a form change as maybe I didn't change you do you think interesting that's that's an interesting observation good catch I will talk to you all tomorrow apologize I was doing that kind of behind my head I forget and oh good I'm glad you're online and you saw that right I almost pronounced you're incorrect well if you meet me add knowledge or a developer meetup or someplace else feel free to correct me I will do my best let's ask how long it took me to get Steve from Sweden correct I will talk to you tomorrow it has been a wonderful day and look forward to sharing more information with you till then take care [Music]
Info
Channel: ServiceNow - Now Community
Views: 441
Rating: 5 out of 5
Keywords:
Id: oyxe39oHWIE
Channel Id: undefined
Length: 63min 33sec (3813 seconds)
Published: Tue Jan 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.