logo

NJP

Enhancing the Karaoke App - Live Coding Happy Hour for 2020-11-20

Import · Nov 21, 2020 · video

e e e e e e [Music] w [Music] hello and welcome to live coding happy hour on this fabulous Friday November 20th 2020 oh it's it's 202020 that's fun um I'm glad the only one who sees number patterns it's like paradia for dates um I'm your host Andrew Barnes uh we've got our usual suspects here let's go around the horn and introduce ourselves and then we'll get to doing our live coding which is why we're here today Brad hello everyone my name is Brad Tilton I'm a developer Advocate with the developer program here at service now I have been veloping on service now for about 12 years and I'm excited to be here this afternoon awesome thanks bad and Chuck I'm Chuck tamasi and I too am a developer Advocate with service now and I have a lot of fun building apps and Integrations and sharing them with you and today we're gonna have some fun awesome and rounding out the corner Andrew Barnes developer advocate here at service now we got the Three Amigos here uh and I am just delighted to be here with you today um before we introduce our beverages of choice today I'm going to show off my new Perry Paris shirt yeah yeah and uh Brad hit us up the uh the previous shirt got a little Orlando shirt Orlando and I got nothing ch's got his bow ties he's he's always prepared with the his versions are Timeless the bow TI is always t-shirts anyway I'm not bitter so what are you drinking today Brad oh surprise I'm drinking a barrel AG Stout uh but this is a KBS uh this is a maple maack fudge Barrel age ma maa I didn't know you could get KBs in Texas wow kiano Brewing that's you know where that is I don't you go as far north in Michigan as you can and keep going into Lake Superior that's about where it is nice okay and what are you what are you drinking today Chuck I have a Viner Dunkle there feels like a little theme going on with with you two we need some diversity on this show we got three white guys drinking the same beer I have got uh can't uh po poala yeah lovely um but the the name is gimme danger um and it's a imperial stout oh let us get rolling with what we're gon to do today so most of you are familiar with what we do on our show but I'm gonna remind you anyway um so thank you for joining us we are going to do some service now uh live development on this show today uh so we have uh you know our crack team of Advocates here and every week one of us uh gets to Showcase uh some development work that they want to accomplish that week um and do it live and we don't practice this um the uh places where we run into interesting errors or just learn things is uh completely unscripted because that's the best way is to see how it's actually done um no matter how many gazillions of years of experience you have you will always be learning something new on this platform which is what makes it the fun uh to me that I like the best is there's always something new to learn and try um and uh and relearn even because five years ago uh me might have known this and no today me doesn't remember but I'll relearn it because it's fun and today Chuck is going to be uh giving us a a early look at our new um CLI so uh tell us a little bit about what we're going to do today uh directly and then we'll get into our screen share Chuck yeah I got to tell you that I've been doing this for almost 40 years and when I started computers were nothing but command lines so this is a bit of a throwback I am I am having fun now because you know running macros and and scripts and whatnot is what I do this whole gooey thing for the kids well you anyway uh we are going to be using the new CLI which will be coming out shortly this is a preview and I did ask our product people can I show this because it's not publicly available yet it will be available in the store you install the the Plugin or the module whatever it is and you will be able to configure endpoints think of it as a a custom curl if you will but you don't have to specify the full URL or your credentials and you know all this stuff to be able to run macro so from a command line whether it's Windows or Mac or Linux you could automate some more stuff in integrate with scripted rest apis or the table apis or any of the built-in apis to be able to carry out actions and Trigger them in the instance from a command line so this is uh pretty pretty powerful stuff I'm G to be doing something kind of fun kind of basic related to the karaoke app there's a feature I'll show you in just a sec to click an icon and it will pull a random favorite from your favorites list and throw that into the queue so I've got you know 700 and some favorites and I go here boom it says now you're singing Beach Boys Next nice do another one click the icon again now you're singing ACDC oh that's a good variety so you know it's it's when I get bored and don't know what to pick I just say go pick something and I I have scripted rest apis for pretty much every action that you see in the service portal whether it's a list of activities the uh the release notes I think are part of that getting a page of songs to display uh sending back the status of whether you favorited a song or not so all these interactions are generally done with a exception of about one or two I think I'm up to about 20 different scripted rest apis for this app and that was after I Consolidated a bunch of them so yeah really get grouped page that is now a thing for favorites and searching and yeah that's uh so I want to be able to trigger some of these actions from a command line as an example of what you might do for uh maybe promoting code or Tri you know triggering your pipeline or running ATF or something where either you've built a script rest API or you're using one that's already on the system you can do that we do ship with some out ofox examples so you're not starting with a blank slate and there is onel screen on screen help try that again on screen help for uh the the command line stuff so it's actually not that complex there's a whopping three tables involved so I think we can muddle our way through this today nice all right well with that um let's move into the screen share and I am screening while you do that um I read I was reading my beer a little bit uh because my gimme danger is a hilarious name and I just realized that it's a it's from Estonia uh which is really cool wow um because I like Estonia uh it's it's a cool place to visit it's about time for my son-in-law to bring me some more Russian beer he goes to the Russian store every once in a while we see screen yes we see screen I'm looking at YouTube we see the screen good now I have to find my cursor among all these screens there we go okay so let me just give you a quick demo of what this looks like I will scoot this over to where we can see this is my logged in service portal karaoke app app on my Dev instance and to show you the favorites I go to the favorites menu and here is what I call derok okay we we may need to zoom out a little bit yeah um the yeah there we go I'm working on it we're get okay so this little crisscross icon here is my der and it pulls from the 725 random favorites and says great I just queued up lab bomba by Richie Val for you and I click it again and it says now happy by frell Williams okay clap along if you feel that happiness anyway uh that's the way it works through the UI and on the back end if I pull up Studio it always helps to have a quick reference to your API I'm going to go to inbound resources yet random favorite I don't navigate this every day yes I do okay and here is my API it has it's it's a simple get it takes a couple of parameters no it has a couple of optional parameters so here's something to consider prior to this I did have to tweak the API a little bit prior to this it expected query parameters for the customer and the region and I need to know the region because I don't want to go grab a favorite that's not in this region so you it'll it'll say hey I queed something up that you're not going to be able to play that's not not good because YouTube videos have regions on them and I don't want to get something from Estonia that I can't play in the US so if you don't Supply them it says oh you didn't give me a customer you're it I'm taking you and then if you didn't give it a region it will use the default region code from your profile which for me is United States so I've got a couple of fallbacks on there originally I didn't have that logic in there but I wanted to make theck quy parameters optional because after all who likes typing in a CIS ID on a command line it's not any fun so think about the way you want if you're creating a rest API think about do you want to pass in display values and translate those in the resource do you want to pass in CIS IDs and use them raw do you want to make optional arguments so that's that's how we're going to approach this and I did have to do a little bit of pre-work on this scripted rest API but before I get to random favorite I want to do something a little simpler there's my command line I got to get back to the right screen I want to do something a little simpler there's also a history feature in here to say what has Chuck done you can see I cued this song I cued this song so there is a rest API also for get activity history and that is here this one takes one uh command line parameter argument which again I believe is optional right it's optional and well no it's not optional you do have to specify it I thought that was another one where I said you could use the default customer but okay we have to pass it a customer ID so we're going to do one with a path parameter one with some query parameters maybe and the cool thing about the command line interface is you set these up and if you don't Supply them you can also do sort of an interactive version so to test it it's kind of fun let's go to the command line now that I know where my apis are headed and the command is simp snc and I said oh God Not Another snc We're Not service now.com anymore kids that died about 10 years ago this I said what does it stand for they said service now CLI okay I can live with that and if you just type that it will give you a nice friendly help like a man page kind of thing anybody familiar with Man pages besides me old unic thing you type in man on a command and it'll tell you so the Now command line interface is Unified tool to manage your service now instance woohoo and it's extensible that's what's cool out of the box comes with help version and configure and record okay so first thing we want to do is configure a user profile yes could you um pull a uh just uh bring up from the bottom your terminal about three lines worth yeah's that that's perfect thank you sir right there okay and I didn't really lose too much did I no I did not that was interesting how it took out the white space and not pushed everything off the top so we've got a couple of command groups and each command group has commands under them so we can say configure profile or record query or whatever and you want to know what you can get out of a configure you type in this and go uh what and it'll tell you configure has a profile nice and if we say snc configure profile it says great you got to do one of these commands list refresh remove or set well it's not that hard to hack your way through this thing snc configure profile set it goes what's your instance that's my instance I think I forgot to delete my default profile so we're just going to walk through this you type in your instance you want basic or OA I will take basic and that's my my login and I'll assume that's my password and how do you want your output sent back to you I haven't tried any of the others except Json so we could experiment since I'm not using the output I wonder what table does what do you think yeah like when I test table didn't even exist so I don't know what that's gonna give me or 1.05 I think I don't know let's try table so it saves the profile and then if you do snc config configure profile list it says you have one default profile you can name these and you can use them by name with a-p or-- profile command in when you're saying I want to hit this command on that instance with this this profile y yeah so let's do yeah as you know all of us are working against you know at least a few different instances at any one time and most develop are working against more than one instance the multiple profiles thing uh is pretty nice that was one of the one of the things I really appreciated the first time I saw this I like how it also pulled back the version says you're on Paris okay so somewhere I know that's buried probably down in user local something or other in a Json file based on appearance but let's do um snc record because I can't remember we could do a query CC record query um then you give it a table name I think see it jumps into interactive mode at this point like uh hey give me a give active equals true and priority equals one uh Fields number short description limit I'm just going to take one offet zero is good display values you could get socities or you get display values I'm gonna say true I want yeah I want display values processing and I got a big fat nothing because I don't have anything in my my incident table or I don't have anything that matches that query um no active true Priority One you can uh if you do snc um record query help it will give you like an example so let's take that same thing but not do that much of a limit let's do limit and these are all configured in the system I'll show you where these are built right now see how it did that little twisty twisty process request thing the one thing I want if anybody has ever done this before and save it to a file it's sending it's doing that little display thing as standard out and it's doing everything as standard out it's not doing anything as standard error so when you do this you see all that ugliness at top where it presented those messages I I don't want any of that it's like that should be my output what that I saved to the file okay and I I've they've got that in the backlog to fix that and separate the output from the output you know the yeah that would be how I would expect to consume it as well because I want to be able to pipe it to other things that was the first thing I did like that's going to be really ugly to pipe or direct or something like like and that's half that's half the power of any command line tool is how it interacts with other command line tools like I agree 100% you get the Mario coin okay so given that let's go back to snc we've got done configure we've done a little bit with record I'm not going to mess around with that too much more because I want to get started on building and it is under command if you spell Command right oh I did spell it right I thought I had three M's in there type in CLI CLI type in CI but it comes up with a few other things too many too many other choices because Cent yeah yeah and do you get anything with command I didn't want to go to my command Okay command will work line in oh line ey that'll work for me any I I like to figure out uh things like yeah like like eace I KFL KFL for work how about espace parenthesis oh for crying out loud debug I should have known there that's pretty cryptic e space parenthesis capital c yeah you don't have to start at the beginning of the word is the point here okay that is fun we've got commands command groups and end points and unfortunately they're ordered logically backwards from where you want to go so the command group is record we're going to put in one for karaoke the the end points are exactly what it sounds like what is the rest end point I want to hit and I notice these don't have a leading slash on them which is interesting but you can see this is pretty much uhoh there coming for you Brad these are pretty much how you would see them in your scripted rest API or any other API and we I'll show you where to specify the query parameters as well so we got that we know how this is put together we start with a command group and under the command group record are the commands create delete get query da da da da da where you specify the endpoint and then in each one of these like we drill into create is where it says here's how you use it I haven't played around or looked at what all of these expressions are determine if the command is succeeded failure I would know I would have thought maybe maybe that comes out of the Json like if you get a 400 or a 500 I I I got to learn more about this I don't know and yeah and and I I looked into what some of these were and some of them appear to be for future use that's kind of what I was thinking what's the call back and how many retried you get it looks like it's built very solidly for the future but we're going to do something simply for the present okay and then our API endpoints so if we say command table we specify the type of parameter we can even have a short name so instead of dh- table or we could just say dasht U we can give a little example for our help message and here's where we put in is it a path parameter a query parameter a body and where do we pull that from oh it's from something else so let's let's build one out of these real quick first let's make a new end point and I already forgot what mine are called so this is my end point copy paste from Studio it's a get did we have the curly braces in the other examples I don't remember feel like yes I feel like yes okay good there we go okay so that's how it's going to know there's mine we have an endpoint declared now let's go make a command group actually we probably should have done the command group first Koke I assume you can structure these hierarchically so you can have a set of command groups because remember we we were playing around with what was it record create or record and it's record query and it said this is a group within a group so I think that's what that was okay have a parent group so we'll just call this uh karaoke commands description interact karaoke app now imagine being uh getting an app from the store that had a set of commands that go with it oh that's pretty powerful stuff anytime you write an app or you have apis that you can tie into this is this is why I like as as though they're a little more labor intensive to do script rest apis from service portal but you can also attack them from really anywhere else the command line being one of them yeah I love I love scripted rest apis I I I use them all the time they're they're my favorite like I'm just like if I need to interact with some data from service now I just like well let's make a scripted rest API and then I can just call it from anywhere and I've started to transition that concept to like flows as well like yeah I'll just go build an action uh because my action is kind of like uh you know an internal API and if I need to expose it to external guess what ha really quick make a scripted rest API that calls my action yes yes I'm I'm starting to do that too migrate from building everything in a script include to building it in actions and subflows and flows that you can call from really anywhere with the flow API so it's it's a new paradigm emerging so we're here in our Command group we've got it we need to now create some commands let's create some commands so let's call this one activity activity activities Koke activities let's do activities plural and our end point is going to be the one we just set up that was pretty easy short description get a list of activities okay and save that and here's where we say what's our arguments we had three if I remember right there was a there was a customer ID and then two query parameters for start and count and count okay so let's go build those real quick name customer now this is the command name not a friendly display name I I was going to upper case those are sensitive um to symbols and so uh use use just regular words uh right at least right now data type is a string default value um you can hardcode something like when I do start it will be zero or count will be 10 default value for customer is interesting because I would love to have the ability to inject JavaScript in here now I did yeah like a JavaScript you know get gs. get user kind of thing okay let's try it I suspect it will work okay let's try that customer sisid we we try things on this show because why not and and the prompt well you know the prompt often looks a lot like the description to me so this is if you don't specify it on the command line it's going to say and we have mandatory we definitely need the society it's not something that I have a default behind the scenes for so that one is mandatory this will not run we'll make this run at order 100 and I expression to use to determine whether the CLI should prompt for the argument typically used to display an argument based on the value provided to a previous argument oh okay so if you have conditional arguments if if I said you know customer if I say customer on the command line then I need two more things you could do that yes what else do I need I need um start short name s I guess make that an integer default value zero um starting record number that one is not mandatory because there is a default in the API I believe yes no shoot I'd have to go in here and find out I still one of my favorite features you I don't use it that often but it is kind of fun isn't it oh man I I probably use that every day get entry get my activities there we go if you didn't provide a start I will assume you want uh no that still doesn't default to a number does it yeah I think we better make this mandatory oh no it defaults here okay I'm good I'm good prompt um start is good for me 200 and that's that new count uh oh I already said c for customer C is for cookie yeah thanks Cookie Monster um short name n number how's that that's a common one when you do like GP um this is also an integer default value 10 number of Records to retrieve prompt count order 300 not mandatory all right we should have everything we need let's go see snc okay the command groups this is where you um I learned a hard lesson actually I discovered it I submitted something to the slack channel that supports this group and before they could answer I figured it out so I like those like never mind um it's snc configure re profile refresh and then I do snc and haha look my karaoke commands are now in the list yeah and so what that does right is it connects to the instance and goes and um you know introspects those tables in which you were just editing those records and pulls down any new commands so that you can actually engage with them here um you know if you just initially set it up right now it would have done that as part of the initial connection but um once you add new commands after you've set up the CLIA that's how you update it and I'm I'm told that they're looking into ways to make that a little more Dynamic so you know I i' I've been on other systems where it's like ah I keep forgetting to refresh right yeah we're we're early in the uh in the journey with this tool here so but you can see there are yeah let's do snc karaoke activities activities it says Sid that's not pretty but let's see what happens start um one one and we got my script include my scripted rest API has an issue it's sent back a 500 defined value has no properties at line four okay I hope we don't have to go backwards in working on this start oh oh oh oh oh oh we didn't tell it what the end Point arguments were it did not pass any of this stuff in like okay those are the arguments now we create the pieces that the API needs so the endpoint argument for this is customer ID make sure you spell that right because I only spelled customer to the other stuff the value is going to come from Flags you can either hard code of value or you put Flags dot whatever from your other related list and it is going to be a path parameter that's how you tie this into what the instance is looking for same kind of thing with start is going to use flags.st start I got all this by looking at the examples there's no great mystery here query parameter and count is flags.com yeah make sure your scripted arest API gets what it needs or it will bark at you okay now we've got those and let's do it again do it again one one say it again say it again dang cursors um it's online four so you know what's funny is that's not the line that's having a problem with the society yet H something doesn't have a start you know what we could also do hold on let's make sure it works for the rest API Explorer ah it seems like good call good okay so I need to know my S which I don't have memorized off hand but I often cheat and do this that's me okay API pop that in there we need a couple of query par parameters for start one count make sure we're not dealing with something more fundamentally broken it was weird because it it did present a history when we looked at the app send 200 okay 200's okay with me 200's okay and the command line is start one count one okay okay and we got a nice Jon payload back so what did we do wrong are we still set on table in your profile set on table in the profile not sure what you mean uh when you were configuring your profile you set your responses to be table and oh you're right and we still don't we still don't know what that does that wouldn't give us a table yeah it didn't give us a table it it well all right you want to change it back in cas I want I want to change it back just to you know to minimize the differences between the scripted rest AP this rest API Explorer oh I just saw ooth plus MFA that was interesting and don't ding it me B on snc config configure profile list okay go back to activities all right let's do this again that one one huh okay something about the output doesn't like stick with Json for now and we get a nice payload back yay we can pass parameters in we can pass parameters out nice Wonder Chuck was a doubter I wonder what that does okay now I'm really curious what table does and what we can do with it yeah me too might be one of those future things that's not ready for us yet yeah this this is not out yet so right there's a reason wait you're saying we never put something out that needs further development I can do some self-deprecating humor anything in the comments that we should know about nope people just having fun okay yep I took a drink for Success on that one thank you upside down drink for success okay now let's go get the one to do the random karaoke song so I've already got my what did we say espace I'm just gonna remember that one now what what is your W while we're distracted anyway what is your favorite uh like shortest uh you know menu thing so mine is d space g uh to get to users and groups that's my favorite one d space g like dog space girl okay well it now it gets you to command groups too it gets you to command groups oh no I'm G have to learn a new one now oh no um I usually do the Canadian user a sorry show all my Canadian friends users with a space will get you to the same spot as well but it's more characters than dpace G that will get you to ail yeah like that's the I want users groups and rolls when I do user space one of the first ones I Learned was ssru free business rules but now that's all over the place um Once Upon a Time YT would get you just two performance analytics but look at what it gets you now there's all kinds of analytics so many things and I liked YT because I don't know if remember any of you remember Ian Bros from our Professional Services Group BR you might remember him yeah he was our implementation guy when I was a customer and also taught me CIS admin before there was a training department and same yeah back in the wooden spaceship when they had no furniture they were going way back now but he would always we weren't using slack way back then we were using um like adum and Google Messenger ADM would tie into aim and Yahoo and you know was a multi- chat client I liked ADM and he would always pop up and say YT for you there that's that's my uh memory for Ian is YT okay where were we sorry I distracted you you were gonna create a new new command part of a password for CR eace parenthesis C okay I was going to make a new command so let's go to command groups karaoke I'm fine we can be distracted and let's do uh we've already had success so yeah little distraction is yeah like we created a command we executed we got the data we expected that was a win I'm thinking we could do a couple of these oh uh we could have favorite random and we could have favorite a particular song or favorite so favorite may actually want to be a command group that's a child of karaoke let's try that I I didn't think about that earlier but let's do a new command group come on Chuck hit the new button call this favorite oh and if you mistype something and fix it later you have still have to do a refresh that's what slowed me down uh parent group karaoke I'm in uncharted waters here um manage your favorites I predict that we will run into that at some point on the show having to refresh and none of us will remember I mean that's I know I will that's not like an oracle prediction like that's just a certainty let's do a new command called random is part of random random yeah I don't know what came out there oh we need our API darn it see this is where it's mandatory and I keep forgetting but maybe we can do this trick oh yeah here we go um it wouldn't no my sis ID is in the command buffer I think we're going to lose that window if we change Tabs are we not no we don't all right happy day do that and pop that in there it's a get this is fun you can see if you're right look it's a get I don't like Flying Blind we don't need these other windows partially obscured but oh I'm totally uh feeling like maybe next next time we do this yeah we could we could build a UI action on your script address thing to create your command that would be interesting yeah you'd have to interspect the the parameters well oh ow um no because this says what query parameters I'm looking for but often times you put them down in in the the associations like the test them down here I don't know that would be tough because your path parameters in Creer parameters aren't looked interesting I I think we can do it I think we can at least get like part of the way there you're driving CA because I watched somebody do copying pasting and I'm like well I can do that with a computer [Laughter] I can tell the computer to copy and paste for me as anyone else okay so favorites um and then we want one argument that's going to say oh wait a minute this is random Comm group favorite pick a random favorite I got the description wrong I thought that sounded a little redundant like a random favorite and this one had optional parameters customer and region so query parameter there query parameter there if it doesn't get one it goes to your profile if it does it okay yeah that's it once upon a time I had the party in there but I figured you know what the party is because the customer has it on their profile what are you doing at the command line if you don't have a party anyway so this will be [Music] customer was it actually called customer in the API yes customer and region code with a Capital C keep that in mind C string is going to be a soci ID oh you know what we didn't look for in the command line CC karaoke activities if we do activities help look what it says for d default okay and starting record number we put a zero in there but it doesn't display zero which I thought was rather intriguing so did I lose you guys am I still online no okay Brad Brad seems distracted so I was just answering questions probably okay all right so watching Andrew answer questions [Laughter] I'm not interesting anymore but okay I'm interested in you gs. getet user ID I would like to see this a little cleaner but we'll we'll go with that customer CIS ID copy that again because that's going to be our prompt order 100 now it's not mandatory in this one because we have the scripted rest API smart enough to say you didn't give me one I'm taking whoever authenticated to run this thing we're with that did we did we figure out that JavaScript gs. user ID worked or didn't work yes it did work it did work it did work oh wow yeah because it was mandatory on the other one not my guess it's it's it works but it's not really displayed all that nice yeah it' be nice to say default you know so here's here's what you can also do um before I finish this up let's try this let's do um command activity and in the examples let's put something in here get users greatest get a page of user activities examples snc karaoke activities customer sis ID start uh int it's an example let's put in an example I need a a sample Society it's not still there darn it here we just need a random Society like that and start zero count 10 so let's do that go back here and refresh see configure profile refresh I should just have a command a macro that says like slash r or something see karaoke activities no help stop abort okay so it does put the example down here but I don't see the description anywh which is interesting but if you fill in the example it will tell you in your help here's a way to use it which I think is very helpful I love examples I'm of those guys that Skips a lot of the apis and says just show me how it's used so back to commands where were we random which is part of favorite we need customer what did favor take region code uh region short name r ring I think would be good default value will make it us just for fun description region or country code spell that right I often misspell it and it's not a uh pretty word uh country code prompt region country code order 200 wish I could put something in there a little more intuitive but for now we'll go with that now let's hook up our endpoint arguments that we cleverly forgot last time this one is customer to flags. customer parameter type was both of these were quiry if I remember right new this was re code value is flags. region that is also a path parameter ready refresh snc karaokey help I just want to see if it's in here we have favorite what happened to activities Oh it's up there oh available commands and command groups okay so it's segregate it that's working it's hierarchical like I wanted it to then if we say favorite help I still don't know if it's going to work favorite help as random as its available command pick a random favorite and if we say favorite random help you can get really deep with this stuff yeah you can and there's customer and region o okay okay let's see if it works random sure mine's good us is fine it's thinking for a long time that made me nervous oh ID undefined yeah this is not the script itself this is a script include all right 65 CE if I remember right that is the favorite script include is not happy nope that's 6529 customer Q it's got to be Q there's only like three of these that I know there it is and what line did it poop out on 407 I know exactly what the problem is yeah yeah I was dealing with this when I was trying to retool the API 407 goes in and says this. is cute it either doesn't know the song the customer or the party because it said id is not found in one of these things H customers right there I passing insane let's go back to the scripted rest API the rest API Explorer let's go back to the rest API Explorer just make sure it's working get random favorite where was it get random favorite and we have two query parameters one is customer and that comes from that's not my Society my Society is hiding over on this page paste that in let's P pass in region code us you got a w on code you is region code a code or is it a CIS ID now I can't remember I thought it was a code code let me look tell me oh random thing what are you looking for if you don't give me a region code get default region code it returns yeah it's a two-letter code it doesn't say ID it's it's a code name your name your functions to tell you what they're going to return are you getting an i ID or is this ID let's send that and that one created one okay so it's got to be something in the way we're passing it in we didn't we didn't forget to hook something up there time I did a refresh right yeah because it prompted for all the new well just in case slash refresh that's as fast as I can do it and then let's do random d c customer id- Rus okay okay that worked for me something wacky with the interactive mode random favorite this ID us okay something's weird with the interactive mode that's good to know JavaScript I know where it's dying yeah but I don't know why it's and why did the interactive mode prompt you for the region code twice it did it did yeah did you see something I did I think it was just a display thing oh one two I only hit enter twice I okay yeah so paste in uh your CIS ID under the interactive I think it's working I think the JavaScript is working when it's default and it's not interactive and the javascript's not wait what say that again when when you're in interactive mode and it's populating the default for you which is the JavaScript but then when it sends that over to service now it says yo you can't you can't send me JavaScript to execute but JavaScript I already have sure I think that's what's happening it worked in the other one but not in interactive mode you sure h no let's try it I thought we did interactive first activities Oh you know what it's probably going this is bogus so I'm going to use one internally to the API it uses the default one that you established in scripted yeah this this probably isn't working at all then this is probably just messing us up we don't want a default value for this okay we were F we were lulled into a false sense of it working and it's not so that should work and that took care of activi good call out Janos uh he they asked earlier about yeah well the JavaScript actually work from the command line and I was like maybe we had to try and uh I was skeptical as well yeah oh now seems like I think I said something right okay all right then we really need we really well no it still doesn't need to be mandatory because the random one is being taken care of by the API but activities does need a mandatory one so what happens if you do let's do a refresh slash refresh okay let's do a refresh and now activities must have a society see how it has an X next to it won't let you go so let's put in mine start two one good okay now if but because karaoke favorite random doesn't necessarily need one it's got a green check mark say I don't need one I'll use yours if you I'll use yeah yeah all right and region code is good and I don't know what I'm singing anymore anyway you want it okay that's what I'm singing anyway you want it which I think is an appropriate place to end off I think it is it's better than the end of the world as we know it true why why is it Angry this is kind of fun it is kind of fun I like command line stuff I understand why the screen is angry at me I can go this way a little bit next time we'll we can in the future we can also see about injecting something in a body like when we do a post because so far I just did a couple of gets which was an easy low hanging fruit but I'd like to learn more about how to do Post commands that um create something how do you structure that body when it's a Json payload or something so lot of fun so uh good good engagement in the chat today thanks thanks for all your contributions uh out there and questions that you were asking along the way uh so to recap uh what we saw was a preview of a soon to be release Store app which is the new uh service Now command CLI which is customizable and configurable um and so you as a developer can do like Chuck did uh which is create your own commands um but additionally other uh app creators including service now can start including those commands as part of their apps um and then allowing you the service now customer developer to uh access and use those um it's shipping with just the table API commands out of box um but as you saw on the show here today it's pretty easy to get started um to to providing your own enhancements to that CLI and then the uh the world is your oyster uh if you like CL and you want to use them then uh this really opens that the door uh for that uh in a a myriad of ways um and I really appreciate you showing that to us Chuck again this is a preview Tech um and it will be coming out you know relatively soon and uh sure we'll have a blog entry on it when it does come out def blog entry for sure and likely another uh episode on it and a footnote as a footnote the karaoke app I I put out the um the latest version with open ID for a Google badge on the on the service portal on Monday and we've had about 60 people that have created new accounts either through the user self- registration or through the Google API the go Google open ID about two-thirds of those have used the Google badge so it's I was blown away by the the proportion of how many would fill in the form for self-registration versus how many would provision via the Google thing and just H that's a statement as to how useful that open ID thing is for getting adoption so think about you know government agency where they want all their citizens to log in well hey you can either go through and fill out a form or you can use an existing account as your SSO and I just I was blown away how how the adoption has grown just from that one badge that was that was pretty cool that's pretty great um so let us uh wrap up by rating our beverages of choice today how was yours Brad I'll go first I had the KBS fudge it's basically a fudge Stout now that I have tried it I'm gonna give it a four it was okay it wasn't awesome I'm gonna have to try that because I grew up having washed your face throughout the thing I was gonna call a 375 oh read the it was it was pretty weird at first I'll be honest I grew I grew to like it yeah all right and what and how was yours Chuck yeah I gotta I gotta find one of those because I grew up up in the Upper Peninsula of Michigan in Marquette and uh KBS came along after I had left but I do know where it is and I've had some of their beers I can't find them around here but my daughter who went to school just a few years ago in at Northern Michigan University has has had those she really doesn't care for KBS too much she's she's become a micro brew afficionado in college which I think is appropriate but anyway yeah she asked me Dad what's your favorite micro brew and Marquette I said there weren't any when I was there was 30 years ago kid um uh the variner Dunkle I'm gonna give it a 425 with the plus two5 success factor so I liked it a lot good good healthy hearty uh full bodied flavored beer without being heavy uh so my uh gimme danger gimme danger um Estonian beer uh was was pretty good like this Imperial Stout like it it it did the work it it had really good flavor there's a tie in there give me danger in any way you want it about catty Shack catty Shack kids Rodney Dangerfield he's out on the golf course that club pops up out of his bag and they start playing any way you want it right right I I doubt half of the people who watch this will we understand go watch CAD Shack this weekend all right that was a long stretch but I got it but but my beer uh yeah it's a 425 it's really good I enjoyed it a lot um so uh thanks so much uh for joining us everyone and I hope uh you know uh we are planning to sneak in a uh a show next week but it's also Thanksgiving week in the US and well things may change uh so we'll we'll most likely see you uh next week but it also could be the following week um but we will have a um next week we will have a community live stream on Monday about data lookup tables and there's a uh breakpoint coming out on Wednesday the 25th a discussion with Tim Woodruff so look for those in wherever you know podast wherever you consume those podcasts you know where to find them everybody yeah awesome so um we appreciate that uh Chuck reminding us that we have some other uh things out there plenty we have a lot of content so head over to developer. servicenow.com uh find any of our content uh that you want to consume as a service now developer it's really your place and your home and it's where I live uh so uh again thank you everyone have a great weekend and if we don't see you next week week we'll see you the following week and I hope you have a great holiday if you're in the US and uh just a wonderful week if you're not bye everybody

View original source

https://www.youtube.com/watch?v=3tXqzXyyvxY