TechNow Ep 68 | Deconstruct! Advanced Service Portal App

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome to tech now the web series for ServiceNow edmonds developers builders on a wide variety of now platform topics I am very excited to be here today this is a topic that we love diving into as developers and even if you're you're not at this level keep this video in your back pocket you may want to dig in further we're going to be taking apart a service portal application and some of the techniques and requirements and and looking at that but before we get into that there's this deconstruct is sort of a proof of concept a prototype we're looking at doing these with other applications maybe not so novel as the use cases we've got today maybe a little more practical that you can use in your enterprise so that's a little bit of what we're here for today my name is Chuck Tomasi I'm a senior TPM emmett service now I had this role for a couple of years been at ServiceNow since 2010 I was a customer for a couple years before that very happy to have been exposed if that that fateful Google search I did years ago in another galaxy far far away that brought me to this point and also very fortunate to be able to share this information with you so we've got a lot of information we can talk more about BIOS and whatnot later but at this point I'll turn it over to our other co-host Craig step who can hey everybody all right and so I'd look at there I clicked the wrong button alright I do we do already have a question for you chuck what is TPM TPM M stand for something to do is bathroom maintenance I'm not sure when I figure it out I'll let you know I'm going to have to kill you that's right anyway I'm Craig step I'm a program manager managed cloud labs and as I said before if you've been to knowledge or taking a mark taking any of our virtual or in-person classes that we offer through the training and certs department at ServiceNow you've probably seen my handiwork on the back end I make all the help spin up all the virtual machines that make the labs possible specialize in cloud automation and I've been with ServiceNow since 2014 so it's a whopping five years almost six now and that puts me in the senior category I think now I don't know maybe what hashtag you get now yeah so well probably both anyway so I've been a co-host of techno since 2016 and I'll move it right along and bring you over to Jeremy Duncan hey folks glad to be here I'm Jeremy Duncan I'm a platform architect on the solution innovation team I am new to ServiceNow the company but been on the ServiceNow platform as a customer developer architect evangelist cheerleader whatever you want to call it for eight years now so remember my first implementation at life layback pre aspen and have had just the honor to really be on the platform and be a part since then so honored to be here on the tech now team and stay tuned and keep watching we glad to have you as part of the team Jeremy Craner to be here what they can expect well on today's show we're going to take a look at managing your favorites as part of our quick tip and we're going to continue or or look at rather the network some network network new york platform features sorry words are failing me right now so anyway and when i I know we probably need to update this live because we thank everybody a million times for a great knowledge 19 I guess we can't thank everybody enough right so put it in your on your calendar get registered for it because before you know it knowledge 2020 is gonna be coming and you don't want to miss it as it's gonna be in Orlando from May 3rd through the 7th it's a great networking opportunity as well as in a learning opportunity because we have workshops from everything to some of the things we're going to be discussing today all the way to you know in Discovery and you name it I'll ever all the products gonna be represented knowledge and it's a great thing set a great place to go and just mingle and talk about like talk with like-minded individuals as yourself and speaking like minded individuals when you're trying to implement service now you've always gonna come up with some questions and some of those questions lead to googling for answers and everything but wait don't use Google just go to service now.com slash success and there's plenty of solutions right there we got white papers from papers from customers that have implemented the product quite frankly you're probably going to be implementing yourself there are solutions documentation you can explore and search through the different modules and find exactly what you're looking for so go over to the customer Success Center and service now.com slash success and you'll find all that information there it's probably way more information than you need or it could be just enough so go check it out and if you need some additional information you're trying to build some things out for your up for yourself go to developer.com and you can get free developer instance you easy access to the two new releases because we do make speaking of New York some of the New York versions were available there before general availability there's free learning plans scripting API you name it there's videos really it's a great place to go and drill down to what you're looking for all the way down to the api's that we have available if you want to get your hands dirty with some code so go check that out over at the pulper so now we're gonna take a look at quick tips I'll turn it over to Chuck already so this is something I was inspired from a gentleman I met at knowledge he came up to me and he said can I organize my favorites a little bit more like the application menus and modules and he actually turned me on to the technical piece that makes this all possible so if your favorites start to look like mine you've got them all random or maybe you're better at sorting them than I am they just kind of get out of hand very very quickly you've got some developer things in place right next to pieces the application you're working on right next to tables for that application it gets chaotic very fast and you go oh wait I need another one and you just throw it in there want to get to something that's a little more laughs scible so you can only you only need to see what you need to see at that given time well that's where this comes in and this idea it takes only a few minutes to implement this is more of an admin thing you know I wouldn't turn your your end-users loose on this quite yet but the two key tables you need to know are sis underscore UI bookmark and sis underscore UI under bookmark group so those are the two pieces the bookmark table a record has a reference to the group and I'll show you how that works in just a second I'm going to do this via slide we're just in the interest of time because there is a lot to cover in the main topic but if anybody wants to see a demo on this I'll be happy to record something else where it is I've done this on the community livestream video we can search for it there as well so the idea is you start by going to the sis UI bookmark under group list there is no module predefined for this so you have to go through the navigation filter in the upper left when you do that you'll get a list of Records go and create yourself some records these are the groups these equate to the application menus you may even have some if you've put a star on an entire application menu it will get all the modules under there and you will have a collapsible things like how did that work it's creating this bookmark group table for you so I typically create one called developer or system where I keep things like studio and scripts background I create another one for logs the event log the system log the mail logs you can put your favorite favorites in those groups this is simply the grouping be sure you fill out the field for user to identify it as you so that obviously it shows up on your favorites the order is up to you how do you want to order these groups and leave the application blank this simply ties it to an existing application menu you don't need it here you don't want it have fun with it so that's step one make yourself some groups step two is just take a look at the list make sure that you filter on your name and it looks like what you expect sort by order to make sure they're in the order do a list edit if you want change them there then you have to do something that I wish was already done out of the box do it once you need to set the display value on that group table to the title field otherwise you will be seeing societies when you try to relate the the the bookmarks to the bookmark groups it will be annoying you won't be able to tell yours from your co-workers so put those on there set that to true you know you all know how to do that configure table when you see the title field set it to true goes oh great now I know what to show in a reference field that's a one time thing next I would configure or skin me personalize the sis UI bookmark list personalize the list add the group field it's obviously going to bring up the list collector aka slush bucket which I'm not supposed to say anymore so list collector put it at the end move it forward up the list somewhere so it looks similar to what you see on the screen that will allow you to quickly do a list and say put this bookmark in the system group put this bookmark in the log group with this bookmark in the TEC now group however you've got your group set up you can quickly piece and parse them don't worry about the order if it says thirteen as your first entry in system for example like well so what it's still going to sort them within those groups by numeric order it doesn't matter if it's thirteen seventeen twenty five or one two three they will be sorted in the right order when they're displayed okay yeah what I just said go and assign those bookmarks to the group just watch out for conflicting names as you can see here Stacy Bailey has one called Tech now I have one Cal Tech now you're going to need to learn is the first one of the second one or you could change your display name to tech now Jack that's how it will display on the left hand you and your colleagues will have to figure this out since I'm on very few systems where I have multiple people doing this particular trick I don't need to worry about it but if you are you'll want to be aware of that you may have conflicts refresh your browser and celebrate your accomplishment with the simplicity you've just done so developer is an entire group of bookmarks very very quick to do very handy I use this all the time in fact I've set up a quick XML so when I jump on a new instance I throw it on there and it's got at least the bones of what I need for developers and logs and then I go from there very helpful oh another helpful hint and you'll see this when I get onto my dev system is to add a group for managing your bookmarks or say if you want to make a change later you don't have to go back to sis underscore UI underscore book mark underscore rubes so some screw-you i underscore bookmark that list and get those tables the hard way you can just click them here and go well I've got my own shortcuts right to where I want to manage Jeremy did you have a question yes Chuck I do so Nick is asking can we get a better front end you I added to the ServiceNow backlog so really I would I would submit that into two questions is there a way for external you know our customers to to get ideas into that backlog and the second question I would ask is you know could we create a UI page is is something that a you know a pro code developer might be able to create a page to do I invite someone to do this I also invite someone to put in an enhancement request you can do that through hi our developers do listen if enough people go look we've got this feature it's available why are we doing this the hard way certainly put that in can't guarantee that it will be in Orlando or Paris but if enough people are asking and I think we're going to a new system where you can actually up vote so get your friends on board oh that baby so I have to double check on how that's going I know that we're changing our enhancement process and addressing those enhancements and defects by severity and up voting is going to be a new factor oh that sounds interesting okay yeah so I I would love to see this as an easy manage my bookmarks you know when you click that pencil or whatever it is on the lower yeah should have a drop-down that has a group you know where you can make your maker use one I put it in a group drag and drop it around bump it up bump it down it's not right after this meeting after our tech now yeah if somebody does build this reach out to us let us know we'll evangelize it will show it off so vote around the community throw it on share definitely all right let's get on with our main topic this is deconstruct we are going to be taking apart the Jeopardy app and showing you some of the requirements and how these were built dive into some deeper topics and then not just say gee this was fun on Jeopardy but what you can do with it in your apps in your organization so there's a what's in it for me slide on every one of these sections so it didn't wanted to say look at what we built it was fun yes it was fun but it it also had some challenges in there and how those challenges were addressed so you can start recognizing what those challenges might be your service portal apps and maybe use some of these techniques to address them as well I'd also like to hear what your ideas are I've even got one in here that goes well you did it with method a in this piece and you did with method B in that piece why did you do that I may not even know the answer but I want to start out we're going to be taking apart the Jeopardy application that we built for specifically for knowledge 19 we play this three times in the developer theater Craig was a contestant rather entertaining one at that you can count them money back for losing so badly but yeah yeah you like 2,400 bucks or what is that about 10 stock options yeah there you go all right Billy calm or excuse me bit Lee / SN - jeopardy is where you can find a community link and there is a link where you can download that from share on the developer portal right from there if you want to get into this and you want to tear it apart load it up on a personal developer instance and look at this exact same code that we're going to be looking at today it's there for you great - that may make an enhancement or - over the next two years so if you're watching this in 2024 the code may be slightly different but the concepts will still be the same all right this is what it looks like on the share portal not going to dwell on that too much if you haven't been to the developer site developer not ServiceNow dot-com there we are sound effects I've got it here we've upped our game on the production quality so let me do a quick screen share and a demonstration of what the gameplay looks like if you haven't seen jeopardy or you're not familiar this is based on the popular TV game show that's been around for thirty years I think it is thirty six as of just the other day September 10th was the anniversary and it started in 1984 exactly it started in 1964 but the curve version I have I have the Jeopardy board this is a variation on trivia only instead of asking a question and getting an answer they asked they they tell you the answer and you have to praise your answer in the form of a question it's laid out in categories and varying difficulties based on that amount so I've got several ServiceNow categories the fuss record let's say we've got her players across the top this is based on one of the games from knowledge got Daniel Michael and Sean Daniel has control of the board he says I'll take the fossil record for a hundred and weed yet he found its service now in 2004 and if you know your fossil record from service now you would know that Daniel can answer that and say who is Fred ludie in which case I click the thumbs up he gets a hundred dollars when we go back to the board directly very easy got it right and he says I'll take the fossil record for 200 this product was a result of the 2000 of sky giraffe and Michael raises his hand or buzzes in or whatever it is and says the incorrect answer and I go oh I'm sorry Michael you get that wrong and it takes $200 out of his account then Sean I think I know and gives another wrong answer and you can see he also loses $200 and Daniel says I'm not touching that with a ten-foot pole so we can March that card as inactive and nobody got any money but Daniel's still in control you can see the amounts on the top have been updated and it says let's try a different category this one's getting out of control we'll do potpourri for 100 and he gets the Daily Double now what you don't hear is a sound effect that's in there of that characteristic Daily Double sound to get everybody's attention and scare the cat that $200 which I don't think you're really allowed to do you're only allowed to bet up to the amount but hey this is my app my rules I try to play as close to the game show as possible but sometimes it's technically not possible to implement every exact rule this one I could have but I'm not going to then he makes his wager we click the Daily Double image and it says this service now website is a place to post your questions and issues and he says of course what is community service now com gets it right gets the $200 added to his account and that's sort of how the Daily Double goes there's more code in final jeopardy which I'll get to in just a minute one other thing I wanted to show you and this gets into the requirements that I wanted is how does the host know the correct answer because at no time did we see the correct answer on that screen and that's what I wanted to show now on the real game Alex Trebek the host of the game show has some cardboard cards in his hand Jimmy that's low-tech I wanted a mobile solution where I could say use this feature to display the exact version blah blah blah and what I built is a mobile app I actually built a service portal page that's called from the now mobile application and while these questions being updated this screen every time something new is displayed on that what I call the card screen where you see the big text with the question or the answer it updates here so that me or Alex or whoever is the host of this show just glances at their phone and says if somebody says stats do or system diagnostic stats they could say that is correct and then of course they end the game whenever they feel like it but you don't have to be doing a whole lot of thing this isn't much of a control panel I didn't want it to be I wanted to keep this simple so that the gameplay was all over here just to be clear that's a that's your scoop that was your phone your display and it looked like it was and we're done okay that was I can back up and say this is this is my phone you can see there's Android controls it's just being displayed through a remote control presentation so we showed the board that was one component that was the first thing I wanted to build is just how do you lay this thing out and like most service portal projects CSS takes 80 percent of your effort the actual data model does and there was also the audio and video components I have images that I put in the game to showed Final Jeopardy double jeopardy there's also a final Jeopardy component which if you're seeing the slides is on the far right where it says hello Daniel Dre's here's your thing you have to answer what is your answer and what is your wager just like real Final Jeopardy only they write it on a little thing I said I wanted them to be able to simply it was all about experience at this point is how easy can I make this for somebody to pull up a phone scan a QR code answer the question that's what I wanted I didn't want them to have to create an account and let's get the game play playing the game okay so those were the challenges now in the screen share I'm sorry a little bit deeper dive in there I'm not gonna go to the creek screenshare yet but I wanted to show you really quickly the data model and how that was built we obviously have a game the game is this is playing techno cheese day or playing game three at knowledge or we're playing the developer meetup in Phoenix we have these games already set up and just contains high-level information then there are cards which have the question and answer he founded ServiceNow in 2004 the answer on that would be who is Fred Lunney blah blah blah it's got an amount it actually got a difficulty not an amount but that's the details of each question and I'm at the bottom tier of this real quick those cards can be used on multiple games based on their categories and the categories can be used on multiple games and the players have a record of their accumulated winnings based on which games each one of these tables has on many-to-many in between it because all of this bottom tier data the cards the players the categories can be repurposed on any game I can use the same ServiceNow category I can use the same Star Trek category I can use the same Lord of the Rings category on any game that I put together it just depends I want to slice and dice this data so quick tip on the bottom that good table naming is very very helpful I attended when Inez for example the the scope on this was X underscore SNC underscore jeopardy and that is called a game not games I have a particular peeve about tables with plurals and um because then your lists get kind of funky and the records get funky and when you're scripting you can't remember is this plural or not so keep life simple stick with a singular table name the many-to-many z-- when you create the definition gives you a definition name it'll say like games cards it's like sis excuse me X SNC jeopardy m2m games cards but that is not a name that I like because it's got plurals in it and it may not be descriptive so keeping a standardized naming scheme becomes very helpful when you start getting into to the scripting components the reporting components where you need access those table names directly so just want to throw that out there this is I like to put best practices out whenever you can get them as far as how I architected this I had the service portal widget for example the card view that you saw up on top has a client script a server script and the HTML component there's CSS in there of course as well I like to do all of my communications with the server through a scripted REST API you can do the C dot server dot update and put more logic in the server script if you wish I like I know there are advantages I've gone through the advanced widget workshop that we did it I think it was knowledge 1718 and possibly even nineteen I don't know if it was around this year but there are some good tips and therefore when you should use them some of them are performance based I'm loading one record so I'm not worried too much about my performance time the server script loads the initial data and then I keep all of the core logic in script includes when I'm updating a record when I'm advancing a player when I'm changing ownership blah blah blah whatever the logic is that has to update that that stays in the script includes as much as possible so I'll show you some examples of this just wanted to give you an architectural view of when is the widget getting an update from the server when is it posting something when is it getting something how are we doing that how is the the whole live thing going on with the host application we'll we'll get into that in just a minute so as far as these various components we've got the Jeopardy board you saw that that was the initial grid it needs to send a message to the card to say display the information for this card this is what Chuck clicked on go put up the question about founding ServiceNow in 2004 that also needs to update the host application which is a totally different service portal page and widget okay so there that's that down and over thing the final jeopardy is also receiving incoming information from the players mobile widget so when they say here's my wager here's my answer submit I want to know things light up on that final Jeopardy board it what that everybody's done submitting their answers we don't have the when you go to a developer meetup or knowledge or even your company picnic may not necessarily have the advantage of having one of those fancy tables that all the jeopardy contestants stand in front of that lights up and says I'm done so this was my mechanism for doing that okay good that's the and by the way you gave them you gave all the contestants a QR code so they could scan it with your phone it took them directly to the the game board where they could put in their their wager yes there was a short URL on there as well because it can be fairly lengthy right so that was again all about experience how quickly can we get these players in there okay so Doug you saw let's go that's the architecture let's go through some of the goals and solutions the goal for my first goal was to add media I wanted that characteristic sound I wanted that dude to dude those jeopardy sounds the final jeopardy the double Daily Double and the timeout button added to this component everything that's not too hard but how do you do that in ServiceNow how do you how do you latch on to that information so I'm gonna give you a demonstration not of the application at this point but of the components that were used to build that so in service portal widget editor I am going to put away my client script and server script for the moment and this is the Jeopardy card when it comes up it checks a few things and when I serve that card to the widget there's a server script component says go get all the card information I want to know is there an image attached to this thing is there a sound attached to this thing what is it what is the answer what is the difficulty all of that so a good data model is crucial in this everything about that card is under data card so I know the attachment name I know the attachment type which you can see and I just do some ng ifs in this thing if there is an image I use an image tag and use the image attachment name the attachment name is going to come from the sis attachment file field and if you haven't done service portal in sis attachment it's going to come out with like sis ID iix doesn't matter that it's not PNG gif jpg whatever it's going to show that picture just fine so this is this is how you display an image and then I use the html5 audio control to say if it's an audio component because I may be doing a musical based Jeopardy game and say you know this song released in 1972 by Carlos Santana blah blah blah thing know that somebody buzzes in an answer you can play that music obviously watch out for licensing issues and put the images that's how we access it but on some of those components like if this was a Daily Double then I'm going to show the image for a Daily Double dot jpg or and/or play the audio where did that come from that's actually quite easy because that is built in to service now if you go under system UI there is an images module and this adds a whole bunch of images that people have uploaded it does respect scope so you can see Final Jeopardy and Daily Double are in this scope they will come along with the application when I publish the update set etc etc so those are easy I reference them and when you go into the record it says you can reference this by using a line of code much like this and if you looked at the widget closely you probably saw something very much like that for the Daily Double image the audio components I think is fairly recent in the last I want to say three four years and I say that half tongue-in-cheek because that's a lot of releases and a lot of changes but I discovered that there is also under system UI an audio files module and by default Connect alert is the only thing in there so I put in and again it gives you sample I didn't give me sample code but you could it was funny the cub was in the ListView yeah I think it was just showing the contents of this audio field to render the player yeah I'm not sure why that's even on the list that's not something you would normally put on a ListView but that's the controller but yeah you could do something very similar to that if you wanted your controller copy that put it in your widget you're done good shortcut Craig you get extra credit for that yeah thank you gold coin all right so that's how I solved the media problem now our media challenge that's that's easy enough to do quick review images in system UI images upload audio to system UI audio files reference it writing your code pretty straightforward and again a robust data model is very helpful i if I had these things scattered all over data about this and data dot that I said look it's all part of card so my server script could just say set data dot card to whatever this script included returns and that way if I need to set another attribute in there I just go into my script include loaded up into the object and say here you go have a nice object back alright next why is this important for me because images and audio can really enhance your portal experience but use them sparingly and where needed especially that audio you don't want your whole office to light up with sounds of double jeopardy when someone you know it submits a surveyor think it knows them responsibly if it's in a good context that you know maybe it's that that's helpful to whoever's whoever's on that but as you're designing your portal applications use them appropriately let's go on to the next one that host app how do we get the dynamic updates onto my phone when I'm hosting this application when I'm hosting a game of Jeopardy to give me the right answers that is due to my good friend record watch and I'm going to first open up a very helpful article you can find on the community published by soosh very smart guy in a simple example this is where I started I just said hey are there any examples of record watch its record watch if search for record watcher I think it also finds this but you'll hear people refer to it as the function is actually called record watch or the method and he gives a great example you can walk through this he says there's so many open incidents and then he says watch for this particular condition on this particular table and update the widget and you've got live widgets I use this all the time on a project I'm working on right now for live lists it's wonderful wonderful in studio excuse me in service portal I use that for the Jeopardy host app I'll show you where that lives in the client script so my host app is very simple it simply says show me the amount the answer and the question very easy to do the server script even more basic it just says go get the active cart now the client script let me turn this this off so you can actually see the client script a little better here is my record watch it's watching this table for any records that change to this condition or that are in this state and change and get updated and then it comes back with an object that I used parse in this function now what I'm doing is updating my scope and then calling where to go calling a function to update a record now the key to this was what's being changed what do I need to display I needed a question and an answer and maybe some other information so how I implemented that I thought was fairly clever this I'm sure me would I know that's just who I am on the game record itself let's take the one we played at DragonCon a couple of weeks ago there is a field called active card that is a name value pair field originally designed for headers on rest api's where you've got a name and a value and a name event this is stored as base on information and if I say show active card it's of type simple name values when you see that in the dictionary it says name slash value pairs I think it's what it's called very easy I put it as read-only because I don't want people coming in here and editing it but when the card record is displayed one of the first things it says is hey go update the game record for what's displayed on the screen and then the host widget says huh the game records been updated sweet I know about that and it gets this information it's it's a handoff plus I've got a record of what was always said I can get back a nice JSON object it's displayed on the form not that I look at this on a regular basis but for debugging this was much easier than reading JSON oh yeah absolutely that's that's how the information is passed from the host application the card to the host application all right I'm keeping an eye on the clock and we've still got a couple more of these to go so that's my demonstration again high-level review name value pair field was very instrumental the card updates it says hey I'm going to display the question about Fred ludie here you go here's the answer here's the question and the host application using record watch to watch this particular record or any that are in this state and says hey something's been updated go update your refresh your screen you'll get the right answer record watch hugely helpful for keeping an idea on lawmaking live widgets whether it's a list or a counter or whatever it is and then the name value pair great way to store simple JSON payloads it is not complex data you can't do an array it is just name value name value name value name value very simple stuff so for situation like this perfect easy to plugin easy to retrieve go to the next use case because I think I got a couple more final jeopardy this was almost like an app unto itself because it had some interesting requirements about allowing as Craig mentioned the players to scan a QR code on their mobile device enter their information put it back the widget that's being displayed on the big display lights up as the players submit their answer it turns Daniel drea same green when he submits turns Michael slobotnik named green when he submits and then when everybody submitted it was it was all over the place and of course there's playing music and showing images and all that good stuff so the secret to doing this yeah I emphasize the experience was everything I was after on that one just make it easy to walk up do Final Jeopardy first you got to remember to tell people to bring their phone that's true the secret for this there's a couple things that needed to be done one is if I go into the players Final Jeopardy outlet that's displayed on their mobile device you know what I'm going to do this at the same time is to make the widget and the page public so underneath my info that's not it under here I've got a public widget that means you don't need credentials to access this but putting making the widget public only is not the final answer you go wow that was pretty bad I don't think you need to go under the service portal page as well now whether you're doing a password reset or something that doesn't need authentication you've got to make the page public and any widgets that are on their public otherwise it's gonna come up and send you to a login page and go hey you want to access this you need credentials the other component that you need to be aware of is since I am doing these updates through a scripted REST API I have my script addressed resources down here and when that person submits I need to make sure that requires authentication down here is turned off so obviously you don't much so that opens you up obviously there are security concerns that you need to keep in mind is if somebody gets ahold of this REST API on this host they could sit there and what if they knew what the parameters were in the payload they can get for these answers so yeah I counted this as a fairly low risk so keep that in mind so public pages great for when you just need somebody to input something quickly maybe it's a survey result it will go to the what's in it for me page or maybe a survey maybe you were one yes could be submitting some anything anonymously could be a situation like this region want them to get in get out do their thing and I really don't care who it was I just need that information and then again record watch was in play here on the big board let's let's go back to the the big board that says the final jeopardy I named my which is fairly poorly in this case let's put that menu away and if you look at the client script there's another record watching here that says hey watch out for those players submitting their answers in this table here's the many-to-many game to play remember that middle tier this is the ear it says watch for any state that's in the state of final jeopardy technically there should only be one and then go and update turn the background to green when they've submitted their record so it knows who submitted what and here's where I varied from the previous example let me go back to the game and not cards games games contract and I have a final jeopardy tab obscure that's not the one it's under the players here's the menu demanding table if we take a look at Gary here he's the guy who did not submit a final Jeopardy question I think we had issues with this but you notice that the final jeopardy is a discrete field Chuck why didn't you use the name value pair field here and I went you know what I don't know I changed my mind I thought about it and it could easily be converted but for this I really only needed those two pieces of information and it really didn't matter much to me plus it allows me to show you two different ways of doing it so this stores that person's wager and answer in two discrete fields all right one more that I want to show you those were the main service portal ones but then I thought as this gets out into the public people are going to be making some pretty cool jeopardy games wouldn't it be great if we had a sort of social component to this and we could take all of this wonderful information that we have around players not necessarily the players because the players for my game are going to vary from yours but the categories the cards the everything let's be able to export all of that rich information in one XML not five where when is the game what is the many-to-many table for the players when is a mini meant that gets tedious one link one XML file and be able to share these things and we've already got some people doing that on the share portal they've uploaded some XML files thank you very much for that I think they'll upload it in the community which is even better and I can show you how that works just by click export game it's not terribly exciting demo it downloads one XML file and when I upload that it which screen is is going to appear on I should have started the text editor first dad I said that was riveting to watch everybody okay up comes vs code with my XML in it and you can see as soon as it finishes refreshing I look really release notes yeah they do that every time don't they I've got the jeopardy game record there's the end of the Jeopardy game record then I get into the many two minigame category you go Chuck how did you do that how did you get multiple tables exported in one UI action it really looks like you exported an update set sort of it kind of does the only difference is it's not on the table sis update XML and there's a couple other tags in there that but very very similar plus if you update in an update set you have to make sure it's going to require those tables to be synced in the update set and we don't always want our dev data going into prod so I don't recommend that path but if you want to share information or you want to do a quick refresh from prod on a certain set of tables here's a way to do it take a look at my UI action in fact I'm going to look at this through studio UI action export game this is part of the Jeopardy app it says do you have the ability can you detect whether the exporter exists now the kicker to this is that the class I need to do that trick it actually comes from an article on SSC guru called exporting Service Catalog items in one step where they do all the variables they do a UI policies all the catalog items very well detailed article I had to adapt it obviously a little bit for my case and the class that is at the heart of all this done with a processor is not available in scope so if I look for what contains not Joe I spelled it wrong Geo I have my export ex my jeopardy exporter that's what's at the heart of all this the UI action something calls this with the right parameter it says what is the game society that I need to export because it's on the game record that's for the UI action is it's called export with related lists that is a global and only global scope which is why this is a separate update set you need to add which is why the UI action says do you have this processor yes or no if you don't know the processor you don't see the link if you do I'll show you the link so the two are related to each other not to make a joke unrelated list it's easy enough to get the directly related list those many to menus that are on that form you just throw them in and you say here's the table and here's the field that relates this records on this table to this table pretty straightforward it's those deeper tables that third tier of cards players categories whatever you want see that take a little more extra work so you have to do a glide record and compile your own list of societies for those I did that for these two tables and oh also don't forget that there is a reference field in there for one more card on Final Jeopardy oh and don't forget that you also have attachments on some of those cards and whatnot so you have to go farming for those oh and don't forget there's actually two tables in there there's this attachment and there's this attachment dock so if you're dealing with attachments it gets a little deep are you aware of that I've exported this file many many times and go to another system import and it didn't quite work the way you want it but once you've got those lists of societies then you simply call the method add query set and if I remember right this is still documented in the docs and dev portal so you can find documentation on these methods you say from this table use this query this ID and the join of that array and I just hung close not when you're ready to explore records super all export records so that's Joker wait yeah I think your question here you know John Anderson came out with the multi-table export tool would that be a helpful tool in doing this as well so that you can include the attachments really easily pick your tables apply your filters and include those attachments with those records would that work here I love it when someone tells me I did it the hard way I I'm terribly familiar with with what John Anderson built I'd love to include a reference in support in the Q&A we can that in the show notes after the show has been processed and back on the community so others can find that love you hear that accent and I future-tech now on it it's a it's a really fun tool and it comes up in every project I work on so sure cool appreciate that's part of the fun of this community thank you very much all right that is what I had to show now why should I care about export with related lists well XML is obviously a great way to share that information include all of the attributes whether it's created dates or modified counts or who's got access to what XML is a great way to share that information intact from system to system right down to the society level and this gives you a way to export multiple lists maybe it's just a single depth that you want to go to maybe it's multiple depths that I had to go through even to a tertiary depth where the cards had attachments it got crazy it was it was a fun exercise but that's what I did in an airport one night so consider building that out do we have before we continue on first of all I wanted before we do our closing and open it up for Q&A thank you everybody for joining us don't sign off yet because I know there's questions we've got and and some reference information but thank you for joining us thank you Craig and Jeremy for for hanging out and given some commentary to this it's it was fun to build it's fun to share and I hope that somebody's got something useful we do look forward to doing other potential deconstruct if you found this useful let us know and we can dig in deeper to some other topics are we related more towards you know ITSM or CSM something like that with actual customer use case scenarios so all of the documentation that I talked about is on Doc's or join the community we've got the developer portal as we mentioned in the beginning of the show where you've got your free personal developer instance we've got a list of all of these shows including this one on the community if you go to bitly slash service now - tech now let me stop the screen sharing at this point yeah we are by the way in our when we post the show I think I had a couple people ask and we I think we were able to provide the links to the couple articles that you were looking for you were referencing but we post those in with the with these out of I think they would appreciate it cool yeah yeah I definitely I'd the the wonder S&C guru and the you wonder the community it will absolutely be intro notes the articles are there and if we don't get your question and answer we've got a few minutes left I want to make sure that you do go back to that list find episode 68 on this deconstruct advanced service portal app click through that and we will have all the questions and answers from everybody that we had you know if you just said hi or I like chucks boat I probably won't be in that list we want to make sure that it's useful information for information for somebody down the road so yeah Jeremy Craig do we have any questions that have come up none that we haven't already answered that I can see anything interesting from what you did answer that might be fruitful for the viewer um actually just well like I said the people were asking about the links I think they were interested in what you were doing a lot of them was a lot of people were replying to me not seeing the bullet this the slides and the browser but that's another issue there's anything in here yeah I think we're good all right Jeremy anything oh nothing for my in Chuck everything's great thanks for hanging your first tech now hope there's many more with you absolutely looking forward to yeah somebody asked one question I know we and you may want to bring this up but when the finding intestines were up with the play in the game we had a children's game they had buttons on it for people to buzz in if somebody said is record watch fast enough to use mobile devices as a buzzer I think it puts a little variability in there I thought about that and I just I thought if somebody's on Verizon and somebody's on AT&T there may be carrier issues and that work is a little iffy exactly yeah or they're on their personal Wi-Fi that would might give them an unfair advantage we don't know it it was just too variable I decided to spend the $70 or whatever because I knew I'd be playing this a number of times and get those little kids buttons the actually work fairly well I do know that was good question good question all right I think we are out of time or darn you're close to it thank you very much again for watching and hanging out with us we hope that you found something useful if not mildly entertaining in here and employ that on your own service portal projects for Jeremy Craig and me Chuck Tomasi have a great day and we'll talk to you next time hi thanks everybody [Music] you
Info
Channel: ServiceNow - Now Community
Views: 3,051
Rating: 5 out of 5
Keywords: ServiceNow, ServiceNow Community, service portal, jeopardy, angularjs, widget, recordwatch
Id: BMiCmfGH_VU
Channel Id: undefined
Length: 52min 30sec (3150 seconds)
Published: Thu Sep 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.