logo

NJP

Localizing your Service Portal widgets - Live Coding Happy Hour for 2020-06-06

Import · Jun 13, 2020 · video

[Music] hello and welcome to live code happy hour for this Friday 12 June June 12 noon 12 to 12 it's the 12th just a 12th any old 12 it's June 12 it is an exciting Friday here it's the at the end of the knowledge digital experience week and let's roll right into introductions with bread hey everybody Brad Tilton I am a developer advocate at ServiceNow with a Developer Program I've been developing on the platform since 2008 and yeah I got nothing after that I was reading what are your articles on the community just four years ago and you were still a partner so you get that there are a lot of those from way back when these are my opinions they don't speak for Accenture senior developer evangelist at ServiceNow was a customer for a couple of years since 2010 I have been at service now doing what I love and and you just celebrated year 10 at ServiceNow past Sunday was my 10 year anniversary so that meant it last show it was just shy and now we're just just after thank you everybody for the well-wishes on on Facebook and Instagram and LinkedIn it's meant the world to me I couldn't be happier being at ServiceNow for 10 years and doing what I love and getting people to share it that's that's the best we're we're excited for you and I'm Andrew Barnes also developer advocate here at ServiceNow and the platform team and I've been on the platform for over five years now not nearly as long as these other fine gentlemen but long enough and specialize in integrations custom application and you know developer pipelining so let's introduce what we're having for drinks today I hope Brad's is got like an umbrella in it I should my AC went out today and in Texas that's not trivial but it's getting fixed anyway I have a from the Texas Texas beer company I have a strawberry King crackles strawberry chocolate stout so we're gonna see how this is I did get it very cold ooh with strawberries like deserts or something and we'll see I have I have to be careful because I set my beer right down next to my bottle of lens cleaner over here what I've got is New Belgium Fat Tire oh the nice haze to it enjoying that this afternoon so I've got a follow on to the one I had a couple of weeks ago Edmunds oast and this one is a sour apricot peach oh the sound had to get that in there all right so this is a new topic this week so this is Anna carrion from any previous weeks so there shouldn't be you know much precursor needed other than let's describe what our problems that is today H other okay I'm working on a service portal actually a widget and a page and the whole portal and I want to make it translation ready I want to I want to build daddy and so I don't have to come back later go this button is in English only on this message but there's some challenges that I've been hitting with dynamic content because things will change on the screen and there's a couple of ways I've been reading Dylan Lindgren's blog I went out to service portal dot IO and I've got some ID what we could do and there's a number of ways we can do this and I've had varied success with plan a and Plan B but they don't feel optimal because a lot of it is client-side say hey now I need a message go do a roundtrip I'd like to see if I could push as much content to the widget as I can that's static and then have the client controller keep up to date when data changes to say oh you know you have four apples and three bananas and if the numbers change it goes and gets the right numbers and rebuilds that message dynamically without having to do you know a plus B plus C it's like you know you get message or something do do it smartly it's those parameters that I'm having problems with and trying to get my head around it and really hoping that somebody out there is able to go know you know you just you know you're doing it wrong I'd be perfectly content with that because that's how we all learn but over the last week or so I have not cracked that nut there's something I'm missing I reached out to Dylan unfortunately he is moving this weekend best of luck to him otherwise he'd be on here in that fourth quadrant with you know sharing things on an early Saturday morning but best of luck to you Dylan we appreciate everything you do on your blog Dylan Lindgren comm I should have the little desk Bell it goes date when you mention somebody website but we are going to be referencing that and hopefully someone is seeing something that I'm not or maybe this just isn't possible I don't know that's sounds like fun it's a good challenge and I'm sure it's something that a lot of our customers need to be aware of or have grappled with is this language independency thing so without further delay what do you say we do a screen share let's do it I think I was on screen three yeah that's the one of our smiling happy faces let's get the zoom window out of the way so I have pre-loaded a couple of test messages in here called demo one two and three mo one is just a static message mo two has one parameter in it and demo three has two parameters in it so I want to at least Exorcist art simple and go from there see what we can do I have also been fiddling around with a test widget that loads up the messages using straight-up GS get message now obviously for demo one it's gonna be great because there's no parameters demo 2 has the one parameter in demo three has the two parameters I've also added a couple of other things up here that we can change via the client control or whatever for my test I have here is an untranslated message and it is straight text this is not what you want in your widgets you know here is untranslated text then I use the dollar curly brace method which gets to the HTML and goes hey guess what I need that message translated into whatever language the user has for the current session and it will go out and do that and if there is no translation in which case there isn't for me it goes and prints whatever the key is this is typical of GS get message as well as hey you don't have anything in sis UI message I'm going to just print whatever is in the curly braces so there you go now this is where it gets fun I have also put up curly brace dollar curly brace demo under one which will show me the key I think no it's it's it's doing something I'm not sure where it's getting that from but it's also pretty on the translated stuff from the server so this is all pre-populated now the trick here is oh here we go when you see like your name is curly breezy row that's what demo - is your name is curly breezy and then since we already did the substitution on the server this will come back with your name is Chuck right because it says go put in the parameter okay hey don't put in the parameter dated that person and it goes what would stated that person data that person is the zero element of data name Chuck Andrew Brad thought I'd keep it interesting in terms of make up demo okay now here's the trick I have a button controller that's going to go get me a new name which runs the new name function and it cycles around the names so watch see the JSON down here on the bottom that by the way is a very nice way to do your data debugging I didn't hear HTML it will stay alive Andrew rad Chuck Andrew Brad Chuck and you can see the index is rolling around with it great but meanwhile this message here is stat static yeah so I went to our friend Dylan and I found his article on translating your widgets building multilingual service portals and he did the first couple he said yeah you can do the dollar curly brace thing and you can do the GS get message then he introduces us to the i18n provider and it has a couple of methods with it load message get message format and you can also do this get message key with values and go okay so format and and this one actually takes some parameters and here's how far I got this is where the wheels fell off really fast okay so let's go to a new name and as we build our message I said Dana dot person is now seat outdated and this is what's rolling around the name when I go quickly quickly hey what I would like to do is rebuild the let's just start simple and rebuild demo data messages demo under to using the i18n controller so I eighty-nine don't forget you got to have that in your client script function I've forgotten that more times than I can count only to go run and it goes no I eighteen n got load message this is the part I don't understand if I'm trying to save myself a server call I guess I'm gonna have to do another server call to get the message or or you know what no we could do that once at the top here right this is like my unload section you do this and say I want to load the message see dot data dot message is plural yes be consistent kids demo under two cuz that's what the article said right you just need to keep no you need the key and the value ah so the key is it could be demo 2 it could be whatever you want I can call this Fred this is the cool part you can make up a new key on the client side but I probably don't want to do that because the key should probably match what the other key is well not necessarily see it's the same as the GS get message key are you guys following along shooting that match it quit so let's just for the sake of consistency call this demo under two and it will it's it's loading the value of this which is gonna have the curly brace zero in it into this key it's almost like a local variable and that by itself doesn't do us any thing what if we do do a yet message which is our next thing we load the key simply supply below function with a key and it will return back the translated value of that key in the current users language so long as it's been pre-loaded using the load message function above all right so I'm dealing with English only so hopefully we'll have some luck with this we do see dot data dot what person know we already know person we want to use that as our parameter we want to save this in messages demo to write you know data dot messages that demo under two equals I eighteen end message yeah I wonder - we're gonna hard code that for a sec we'll be back later to take a stronger look at just making sure I got my semicolons and everything in order that should start reasonable now update this line as we click through so let's save and click nope no click is anything changing nope the index is changing and pressure was changing before that was already happening see that data die messages - and interesting let's have some more fun and just see what came out of that with a console log message I don't know what do you say you know data duck message is do we have anybody in the chat speaking up console log and ooh let's read but let's try that again I know that the well not no no no no no a command ass in the wrong place this get is because it is trying to get something that I really don't care about right now and it doesn't matter click your name is Chuck click your name is Chuck okay that's not it see that's not even what I was getting last night with that a little bit over there we are rotating through mo - in that person oh oh oh oh you know why because this get message just I really would have expected to see the curly brace in there because it hasn't done the key value pair which is you could try doing a format with message and I'm guessing messages the output of this your message contains substitution placeholders pass the message into this function as the first parameter and the following parameters being values you want to put into the placeholders doesn't say anything about return values though but let's try that okay so we have our message in this really should be like VAR message could you collapse HTML template just I certainly can let's collapse that and let's we probably don't need any out of the server right now either how's that thank you we can begin the font to if you want no it's just the sliding back and forth his good point a little hard yeah keep context yeah okay so this should really be let's see what MSG comes out to be not that you want that on your food click your name is Chuck name is Chuck your name is Chuck no fun we're never changing - Oh lime lime for loads once and then when we got our lime five lose in the format format message parm 1 perm to format message C dot data dot person maybe I don't know if that change his message in line as a or it's gonna output something else let's do this far message to because we can't spell either let's do console message plus two yeah is as slow as it goes people that's what you save console says my name is Chuck your name is Chuck your name is Chuck your name is Chuck your name is Chuck okay so this format thing I'm not understanding how do you get the parameter back in there because it appears that this is already it's not doing the curly Barry zero thing doesn't offer that to me then there's always this get message key with value let's just copy that because this is fun too yeah I'd say what that's returning bar key with he with value equals our key is was it not demo under two with values let's just put in Cidade data that person I want this to change I command the log file to give me something good I think that actually works your name is Chuck Chuck oh you know I didn't display anything here he with value Eagles that was probably good that's nice and all but load on clear click he would value your name is Chuck key with value your name is Chuck I I don't know it's like once the it's not picking up the key it's picking up the message already oh you know what maybe we shouldn't put in the name maybe we should just send set up all the keys in the server script and not do the translation by the substitution part here maybe if we just set up a bunch of keys in sedated messages then we can do the parameter transformation I don't know that we're ever actually changing the data object right because it's being reflected in here in the H on line 14 he's changing the data object see that data that person is being changed right there right just the person it's not changing see that data that messages right that's what we're trying to do is okay so you think we need to update CD I think you need to explicitly change yeah oh that's interesting your name is a your name is B and your name is see Andrew bread truck maybe C sir because we're passing the key as curly-brace Iiro and at least format or enough format what was message to doing your name is Andrew your name is Brad your name is Chuck format is working message 2 is coming out with the right thing because it says all right I got you the message with the get message I formatted it I don't know what this with key value pairs is doing because it's coming out with your name is a be like the first letter that's not doing much good at this point what we should be doing is yeah just nuke 20 and 21 right because there's no value there I'm not sure what it would have been nice if it worked because then you could do in one statement and then let's take this and we really don't need that but if we save it back to C dot data messages that demo 2 we'll lose our curly Barry zero because it'll put in a hard-coded value and we won't be able to retranslate it later huh or not hmm that's an interesting thought I'm not sure I followed that thought yeah can you suggest a slower with smaller words cuz I don't think I followed that one right now demo under two has curly brace arrow in it from the server it's doing no parameter replacement okay if we start jigging with it in the client script we could lose that capability to do the substitution I mean you do have the ability to to rerun some of your server-side script right so you can do a visit see that server dot update from the client side of the widget or I get and rerun part of that server-side script make made are I'm wondering why it's starting on index 1 index 0 Chuck oh because it's not displaying the initial value nevermind okay it was off by one say that again bread so if we need to do the substitution on the server side we can rerun some of that server side if we need to to refresh the data object I don't know that I'm inclined to do a C dot server dot update that seems like just I mean you why not just have scope that new name the client function say well just go rerun the that part of the the client script or the server script and we'll be done with it I mean you could put something into the in tab that that I don't know that that feels any more efficient than doing a round-trip anyway because we don't need all of these messages reloaded we just want to tweak the one we've got or the ones that are important to displaying a dynamic message okay are we still on track here Andrew Brad Chuck Andrew Brad Chuck yay okay so what your thought was let's take this instead of that let's do C dot data dot messages that demo under to see what happens is ultimately that would be nice if we could get this message to be a little more dynamic okay initial load did it save I didn't see the save there we go we need the dancing dots saved your name is I click this and it says Andrew and it goes kaboom Wow Oh message 2 is not set this is our key this is our message messages demo under two right we're formatting or meaning the message with parameters and this should be this really don't care because the HTML will render it now all right there and then it's stuck yeah we need the curly braces in there the whole time anytime you encounter the format I think it's what's doing is saying okay I'm gonna format it I'm gonna look for a dollar curly brace erode all that curly brace one dollar curly brace to so you can't monkey with them before they get to that point or you're gonna lose that capability they becomes static I think I'm starting to understand oh okay I want try the apples we really need a temporary so hmm you need like a template messages this should be like the messages that come from sis UI message as patterns and then we could have our output messages object or array yeah I think that's what we're gonna have to do that's not optimal see what I'm saying if we can't if we can't mess with data that message is demo2 without breaking it we still want to be able to reference it at some point mm-hmm what if what do you have no this is this is I'm trying to think and design at the same time data dot text there we go this would be a new object the thing and into that we are going to put the answers and type without extra semicolons in quotes we'll put text not demo - I don't know what that plus equals all about saw that mean here we have our output so when we start clicking we'll see a new object with our answers we can that that leaves the templates in place and then if you want to display those messages you can go get them so let's see click your name is Andrew your name is Brad that would work we go that could work it's not optimal but you'd have an array of text messages that you could make dynamic based on any key you wanted without disrupting the templates so messages would be what comes out of sis UI message should we try to be brave and see if we can get the other one going with two parameters yeah if we can do one good one you can do two apples plus plus and [Music] so you got dated up bananas - - we'll do something with those other two parameters then we'll go get the bar you know which is use msg again right Anders suggests a minute here doing it this way that that you're gonna have to do a translation when you start on load I'm going to have to do a transition yes so really we've got the load when you're not calling this function until you click that button yep you're right we should really be putting some of this into it like its own little private function and then just calling that like update text oops function you know I'm just gonna root for sit we should have that and then we could call update text here for this is an update and this would be our load we could put this up here update text yeah maybe I don't know just what's right okay let's format that up a little better and then we loaded demo we loaded this into the demo TKE demo - key this is kind of our onload section so let's continue with that example copy paste demo 3 it says go get me that message although here's where I struggle why do we need that message in the load message what does getkey need that if it's just going to be using C data type messages whatever as its pattern that doesn't seem alright we'll start commenting things out once we get it working it's a good idea first get it working ugly then get it working 18 and get message ml 3 did I put a 3 on the end of that second line on line 6 no because that would have been fun hi your name is 4 and we get the demo three key out of whatever load message did good I don't think my understanding is complete yet data.txt demo under three calls I 18 n dot format C dot data dot messages demo under three see data apples C data dot bananas I don't know if that supposed to be an array or just comma separated because with get GSD a message it's supposed to be an array we'll find out hey save you something blew up in our face I can't even read that update text is not defined a text is not define sure it is whoops good thing I saved i gestured backwards the rescript client script update text equals function you have a scoping issue here somewhere right you're the one that said it looked okay can't blame me really I have a lot of times put little functions in that are called all over the other functions do need to make a provider at this point is that what it's barfing on and then her texts s update text is not defined sure enough update text is not defined it's not a typo is it we'll just do the old copy-paste here just to see what happens anybody anybody oh yeah missing of our update text Oh general I don't put those into that but okay Andrew I'm gonna go with your idea no log do it one more time save no not that save if you have your you have your cursor your focus in the console window save wants to save the screen yet have it in some code okay won't even work in the preview window well we got a message that update text is outside the scope of of your function above so to write no not supposed to be outside of you know the line should be outside of it it's outside of this is here we can match the parentheses there 24 is matched with that with 10 syntax checking this is my least favorite way to go so generally when I see oh yeah oh oh I have a no that's matched I thought maybe it was a mismatched curly brace but that wouldn't even that would have been a bigger kaboom alright let's just do this for lack of time you put it down at the end let's just there goodbye update text we'll worry about you later in some other life time we're just gonna kept copy and paste which I learned from a conversation with David Liu not too long ago he said one of Fred Letty's cardinal sins was copy and paste said if you copy and paste you're fired you're not thinking objectively so I would have just got fired from Fred's development team I would get fired every day cuz I copy and paste everything well it's okay if you're starting with something and then modifying okay that doesn't work but if you if you had the same code in a lot of places in the Plateau yeah no that's not my kind of copy pasting I mean like write copy and field names cuz I won't type them copy them and this would have been a fireable offense I just copied the same problem into two places potentially okay we've got our text says ten apples five bananas initially it's correct eleven and four hey things are kind of working we just got to figure out what's up with that function alright now here's the part that I want to know about what good is load message doing us at this point is it just setting up this key that get messages using or maybe that was my question what good is get message doing how are these hitched together because this feels like it's because I'm passing format a message that's already got the keys in it or is my key actually and and I think Dylan tried to spell that out in his blog but I didn't read it but so it says use load message to load the message into the client-side 18 and provide I 18 end provider I get that that's kind of like your GS get message then it says use get message to get the key but you've already see the key that's oh wait you're setting up a key then you're using this key you're using this message this is the part that feels a little funny because isn't the value here the same as the message here like that's how we're using it it is this is coming from see data that messages da demo under - and this is also using C dot data dot because we haven't changed anything that's what feels are a little redundant to me we're using C data messages demo - as our value because I thought the load messages from reading that was that we're prefetching this stuff and then the get message is actually like acquiring it from our one already retrieved client-side bucket in making it available available to me as an individual so I could potentially I could potentially do without the server-side stuff without pre loading data dot messages if I had the patterns already loaded up in here but I'm trying to figure out why this feels so dang redundant yeah I don't think you need data dot messages on the server side script I think that is correct like okay if we do without that let's let's try that I'm not sure what just happened here are you I think collapse blocks like this still goes ten eleven yeah it's just just the stuff but between the brackets right which happens only be one line I suppose because you could have an array that has been lots of loans that's funny okay if we don't have that then we can't reference it here right yeah we would have to use the pattern itself like your name is baby baby try that sure okay this will be the value you know that would save us I don't know that would save us a whole lot because it's I still prefer I don't think it's saving us anything but I still is less this UI message so you can send it off to a translation service and then now we get down to format and format once to format the message wouldn't message be the output of get message it's getting it that's what I'm missing here is there needs to be some return values on this thing Dylan so why don't you see what take a look at what you get from get message and see if you need to format it will log got yeah like just see what it is go ahead and give us back the server-side script part and because you did not actually give us an extra parenthesis on the end yeah server-side stuff oh you want this back yeah I mean probably mine 5 in the client script back line 5 you mean with the cdata that messages again yeah alright cuz I mean I want to I want to just change one thing at a time oh so where's the fun in that [Laughter] alright we're back to where we were yeah like click click and you wanted to see what the output was yeah I wanted to see what's different between the output of get message and the output of format we have a clog that spit out demo three and it says the output is curly brace apples and curly brace bananas and then what do I get from the formatter that stay formatter does the parameter substitution Wow okay so we go yeah so it's filling in the values of this is read this is redundant I could and probably should that's a terrible word but you know we said III here we're getting back effectively the same thing as we already so we don't have to retrieve it from seed out data again we already have it we try and I like retrieving from seed and save yet only brace banana Joe that was the console message from before I think so we go click click still seems to be working I don't know improved anything or made a major difference in the universe but and so is the get message I feel is the get message needed as well so the old message get message and format message this loads this loads up almost like a local key to the client right is you have a key called demo to the get message you know what does the get message do because we've already got that here all right let's try it why not why not what is the initial value of this demo under two so without that it doesn't actually not very happy okay until you but that's because we got into this what's it into the rolling function Oh 27 sting they have to go together but it doesn't feel like it's a very efficient way to put this all together oh wait a minute wait a minute wait a minute wait a minute wait a minute we did we undid bread's two things at once thing we should not have monkey to a demo to and what we should have done demo three no cuz that would capture then there's a variable B undefined yeah okay no we did that right what you only have to do load message once yep you have to do get message multiple times let's try that let's go into the loop and oh that's a good question yeah I mean format makes sense I'm doing parameter substitutions all day and all night look at that so get message a and get message isn't even storing anything it's just sort of there it's just available it's like once I've executed it you could do that and you could do so I could have a a nice starter block that loaded a series of messages and did a get message for those series of message messages that I loaded and then they'd be available for right oh wait a minute we've been still using the old pattern down here we're not done yet with this crazy mystery this should be using our key let's see if the key has the right scope as it were okay we're trying to clean it up and make sense because I know de mo hmm Wow no it is I mean I I got confused no it's fine you got a Helbig everything right next to your format apparently because this demo Tookie is not aware of the load message that it did up here mmm interesting really interesting that was disappointing but it worked when you passed in I was using the data up messages pattern first 45 minutes and we're still learning this is a good day well until I die I'm gonna I'm gonna keep trying you wanted oh wow okay now I'm still confused you have to have a load message and a get message and a format to make this all work that's not fair why do much if I reload it comes up and it says oh why is data dot text wrong here oh we broke something initially I thought it was broken in the in the iteration our unload is out of whack this is not making sense we have a load message we have a get message and we have a format and that is not working right now because our object is not being initially loaded with good text and loaded with keys what are these keys or it doesn't have any purpose let's go back to the way things were we had oh now this is where I go how did we make it work before rewind the video yeah so the way we made it work before is we yeah we just referenced you to get message that the server had done Emma under - did that work that were so where could we change it again it feels really redundant like we have to do the get message from the server script then why do we need the load message exactly if it's loading a pattern into this key and that key is being used for this get message this feels totally redundant to this but apparently well now wait a minute let's keep going do we need them let's comment out the load message and the get message and see what happens to our old friend format because he doesn't have a key your name is Joe I think I'm hereby officially deprecating load message and get message and just using format let's try down here dad did they comment that out it feels better you're only getting the pattern once and you're only doing the substitution once message is that demo - ok your name is truck name is Andrew my name is Brad I think that's that our Minimum Viable Product it's just use get message to load up your objects and then use those as the patterns with the carrot with the parameters you want to substitute with format yeah I'm finding no value in load message and get message someone no and that just means that I don't understand what their purposes is then right cuz yeah because if they don't appear to be necessary then I'm probably not understanding cuz we didn't make it whoever made load message didn't make it - not to be used not sure what what are we got in the comments andrew says I reckon at this point I just update the data object and reload the server side skip the whole client side translate [Laughter] no that's what Jase feels extra confused oh man then we really won I I don't know about you but I had called a success we've kind of figured out what we need and what we don't need to make this actually translate on-the-fly with parameters I mean Jay said if someone put it in there just to confuse me then they have succeeded I my hats off to them because I don't know why we need that if it if it doesn't appear to be necessary I don't find it nests of the whole crux is first let's make it work and then why is this feel so redundant because it actually is yeah because the the format part seems and no it's I'm gonna have to dive into to what the load message is actually doing you know what I didn't check up here that's funny Jase them no you actually made me laugh sir that was good thank you I appreciate that ask the dog's teeth so this needs to be change from see that did it have messages to see that data to text and then we will get our dynamic HTML no well that's interesting we were so close my banner is in the way let me turn that off where is it it's I won that one hide label you name is Brad text mo - MO - si doubt data messages demo - we won't change that to text messages save I want to see the HTML update not just the JSON debugging stuff your name is Chuck Andrew Brad it it still doesn't feel that pleasant to have two sets of objects one for the patterns and one for the output but I can live with it but I can live with it yeah I can live with that if someone has an explanation of what F and if you come around later and you're watching this and you're like oh I know exactly what they need it and why they were silly please put a comment on the YouTube or send an email right over to me at Andrew dot Barnes at ServiceNow calm and and we'll update the comment at the description on the video and and maybe even write a detailed blog post about it because this definitely could use some illumination I think agreed sounds like you need a script search that is the answer to many questions they are Andrew which is I don't understand how this API works let me go look how other people have used this API your code searching and the platform is a very powerful tool for that now you see how someone else used this API which might also be old you who understood it I've had that happen there's there's code that I wrote and went I don't know if I was smoking something good had a really good imagination or was really smart that day but I don't understand this anymore alright well that feels like a little bit of victory there Chuck is there anything else that you want to tweak real quick before we wrap up here no only to mention that I did engage one of our developers about the YouTube header thing and it turns out that it might be the YouTube API we were trying that whole API key thing that I mentioned last time it working out a YouTube spoke and I need an API key credential I'm not doing oh oh I'm doing the API key because that's often how applications talk to applications and I was doing the / what is it / video API and it wasn't working he said oh it works on channels okay that's interesting so we may have more variables that play that we thought originally it might not be our rest step doing something it shouldn't it might be you to be inconsistent but we haven't run into that before have we yes so we could drop out a share and we could drop out a share where's my sharing thing let's get out of there all right everybody for joining us and playing along with what's going on here log this log that what is just doing a little JSON I put a pre tag around that that is a excellent excellent debugging step right there is yeah lowers the need for log injuries you know I learned that I did a voiceover for this yeah debug the widget debugging the service portal debugging video that's on the server's NetSupport channel like four or five six different topics there was console log in the server there was console log in the client and then they had those you can debug in the HTML I mean that's really nice and it's formatted going there so right now I'm writing a number of widgets so they all have these big ugly JSON things on the hanging off the bottom but like I can see exactly what I want to see yeah that's great suggestion and just debugging in general in the platform a those those what we suggested already which was do a code search so fire up studio and click in the top right code search and do do a code search for the API that you're looking for that will reveal other other application files in the system that are already leveraging that and you can see from their context and even usually you can align with an application file of the same type so if you're working on a script include look in script includes that are doing that if you're working on a business rule look in business rules that are doing that just just so you can get as close to an example as possible and then when you're doing server-side debugging don't forget those break points that are there that you can click on and start doing script debugging if you're doing anything asynchronously or synchronously not asynchronously because it doesn't work for that yeah the script debugger has really been a great boon to to shortening the debug cycle hey synchronously like you said still takes a little bit of elbow grease yeah so usually what happens with an async thing is I'll just try and invoke it synchronously so that might mean substituting it somewhere else and invoking it with some parameters into it you know calling it from the background script area like there's some ways to invoke code synchronously that is typically a thing but but yeah that it's a big boon seeing stick being able to step through and see what is affecting your objects and in which thing you know which business rule is touching them is really powerful yeah so that was awesome thank you chuck let us go back around the horn and oh wait Brad did you have something you wanted to share first don't you know all right well then you you shall share your beer right well so my my King crackles strawberry stout was pretty good I'm gonna give it a I'm gonna give it a 4 a 4 that's I was a little lang wasn't sure looking at the label like that it was gonna hi yeah I was I was a little nervous about it but it I like a surprise under the wrapper so and you Chuck how was your beverage of choice today tire from New Belgium mmm Fat Tire is like a 45 for me I think I would agree this is this is a 4 to 5 nicely it's summertime nice and hot out here in Phoenix that would taste good I still gotta go get me some Rattlers [Laughter] it's uh it's pretty hot here in North Carolina - not not not either of yours either either of your hots but it's pretty hot for us this sour apricot peach that I have from Charleston South Carolina is pretty tasty this this brewery is got that there there now on my list of good things that might be a four or five months explain about this this is fantastic I would drink this any day so I'm landed four or five we hit a little victory it was a little rough but we hit a little victory that lands a four or five I think we've wrapped up I'll thank you so much for participating in the chat those of you that did we really appreciate all the engagement and thank you for participating in the knowledge experience we we recently released over the past three days a series of blogs on the developer site developer dot ServiceNow comm slash blog that do for mobile now experience flow designer and virtual agent the content that we thought should be highlighted for those four big topic areas in in the knowledge twenty experience so most of you know there's some breakouts in there and there's some demos and some workshops there's a variety of different content for those four big platform areas that we thought we'd highlight those areas and some of the content within those anything else to share before we say goodbye for another wonderful week we've got a tech now on the 23rd with Michael slobotnik showing flow designer and integration hub all the things that have come along in Madrid you or Orlando because we haven't talked about a lot of that stuff in a while so he's gonna spotlight those and do some demos so join us for that bitly /t n76 re g go register for tech now 76 over there look forward to seeing you awesome and anything from your breath not today thanks everybody alright well have a great weekend and if you're seeing this later I hope you haven't enjoyed the show and we'll see you next time next Friday usual time usual place bye everybody yeah

View original source

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