logo

NJP

Decision Table APIs - Live Coding Happy Hour for 2023-03-10

Import · Mar 10, 2023 · video

foreign [Music] thank you [Music] foreign [Music] happy hour this is the show where we take you through some servicenow stuff and we have no idea what we're doing well actually we have an idea we have a goal we're going to show you the thought process we're going to skin our elbows and bang our Knuckles and you know you get to join right along with us for some strange reason this is popular with people watching other people inflict developer pain on themselves that's the premise of the show I like to call it the antithesis of a well-oiled demo so let's go around and do some introduction starting with that man right over there hi everyone I am Earl Duque I'm a developer advocate here at servicenow I'm about almost two years into it but before that I was mostly in higher ed for working for a bunch of different schools doing servicenow engineering and leading like development teams and all that fun stuff I get to show you show you the topic today and I'll pass it over to Lauren my name is Laura McMan and then I'm also a developer Advocate on the same to Earl Chuck and Prana ulation I worked as a servicenow customer and then I was on the SC team for a while for Creator workflows so really excited to be here and I'll kick things over to my wrong way over to my my right the computers left to Drew hi everyone my name is through I am a technical architect at Accenture base out of London at the moment and uh I think third time three times Dave MVP and pretty excited about some API stuff going onto Broadway and finally Chuck on oh should we call you proxy pranav proxy front of you can call Prada proxy drove oh it's the real drove we got him and my name is Chuck tabassi senior developer Advocate at service now been with the company since 2010 it was a customer for a couple of years before that and have a long long Tech History going way way back I realized a few weeks ago that I'm now in my fifth decade on my tech Journey so may you all have a wonderful Journey as well all right let's go around this time and since this is live coding happy hour we'll introduce what we are drinking oh well I'll start okay I actually made a cocktail um so if uh Adam is in the audience listening uh Adam got me into espresso making a very deep dive into an expensive hobby but I made a uh espresso Martini so it's a little bit of Kahlua a little bit of vodka some espresso and a simple sugar all mixed together I'm gonna try it out today wow that sounds good I love it all fancy I just can't handle the caffeine anymore how about you Lauren what do you got well similarly but definitely not as cool I am also going the caffeinated brow instead of instead of uh so I picked one of those one of those up from the grocery store I figured since it's in a can it kind of substitutes for a beer no I want sushi [Laughter] but it's pizza night drove do we have to even guess goodness yes it has no and there's no Coke today so okay no so yeah it's uh actually uh it's Friday so I was filling in the my performance review sheet so can't mess with anything so just water in this WonderCon oh this is sure this is actually droof yeah yeah change is constant man change is constant change is the only constant I I would say something but I might spoil those who haven't watched the latest seasons of Picard because I could punch a hole right through that anyway if you have you know where I was going with that and I am drinking a Kona longboard Island lager you know what Kona is also famous for their coffee coffee no coffee in here this is just a straight up lager I don't even know how long it's been in the fridge or where it came from does it have an expiration I don't want to know so I'll be drinking it all out of my servicenow sales kickoff 2021 Yeti we got the swag going today oh that's a great sound isn't it fast man it's the best okay intro's over drinks are started Earl what are we doing today okay so we are if you haven't seen the episode title yet decision tables API uh before we jump into an actual deep dive into the scripting uh because it's it's an API so it's mostly scripting uh one of the things I wanted to talk about before we jumped in is why I wanted to do such a heavy scripting episode and part of that was because when I was a servicenow developer and I was working for servicenow yet but uh learning a lot these episodes of live coding happy hour were very helpful to me even even though it was light-hearted and oftentimes no actual solution was created and a lot of the topics would end early um but back in the day it wasn't that case live coding happy hour would continue like if they hit a wall the next episode would be part two and then after that would be part three until they got to the end and because of those helpful videos I learned a lot I would sit there and watch three hours of back to back live coding happy hour episodes on a single topic because following someone trying to actually do the development was easier to follow than a very polished demo and that's why we kept doing this show was because it's it's more realistic of the actual Dev cycle of things and the specific one I'm thinking about was the one uh where Dave Slusher went through for three hours talking about how to create a chat bot and that those episodes was what enabled me to create a community bot for SN devs which kind of helped me launch into the community and be more active and stuff like that and so those old videos were super helpful to me and I wanted to I want to try to bring that a little bit back to life coding happy hour and uh if we hit a topic and we don't finish then I'm going to come back even if it's in the middle of the night and finish the do another part to try to get it going uh and also just like nostalgic reasons live coding happy hour was the first show that I appeared on for the deaf program when I was just an employee like four jobs ago or something like that so uh the opportunities I got as a servicenow engineer developer I want to make sure we have all that stuff for you all um Drew is an MVP attending uh we have random guests up here on our show uh all the people in the audience we love chatting and we love hearing all about those things but if we can build actual content that helps you get from point A to Z on a topic and years down the line people are still referring to it then hopefully I've done my job and so uh that's another reason like when I do these episodes that's why we always have so much more guests or that's why we try to invite more people it's because the community is what makes us and uh right now the community is such a big differentiator from us to the our competitors because our community is great and I want to keep diving in cool so I'm going to get into the content now uh let me click a button nope not that button that button hey all right so decision table apis um I'm going to be showing you all of this in my PDI so it's not like a pre-prepared instance I actually haven't really done anything on this instance so it's pretty clean it is on Utah which is where this API has been implemented so I'm going to jump in if you don't know what decision table if you don't know what decision tables are I'll get into it you'll be able to see uh for all the people paying attention at home I've already pre-zoomed in my instance so yeah we don't have to say I've already done it but decision table is uh away I think it was introduced it was introduced a while ago um Madrid I think Edition tables are introduced in Madrid and it was a way for us to programmatically allow for different inputs to determine a result without having to script them and hard code them into your scripts so you can imagine if you have done a lot of scripting that's when you get a really long case statement or a really long ill if else tree um in a decision table you can map it out there and then update those individual parts and then it uh becomes something that you can call back you can do it in a flow you can do it in a script Etc yeah it's a great way to abstract the logic the decision making the decision criteria from the actual flow so if somebody says hey we're changing our loyalty program from 50 000 points to sixty thousand points you go and you change the decision table you don't have to touch the flow you don't have to touch any scripting or whatever it it's it it's it's just a different entity that you can modify very much like Bill lookup tables we still have those I shouldn't say old lookup tables are still around but it lets you separate that decision-making progress or somebody comes along and says oh we've got a uh another option instead of one two three and four we're gonna have a five great throw it in the decision table and Away you go so I love them I look for any opportunity to use them I was able to take some old script that date you mentioned Dave and Josh they they wrote some stuff for us to integrate with meetup.com and I was able to take literally hundreds of lines of code and squash it down into a very simple flow and decision table so the future Chuck or Lauren or Earl can look at this understand what's going on and make modifications later similarly for me the first time we got to use it was for an emergency notification app so there was all these matrices of like who is her if anyone how many people were hurt did the machine malfunctioning delay production and like all those before were just if statements so having decision tables oh my gosh it was it instantly won me over yeah and it's it's best for the developers like us uh so it's a saying in IIT that you know systems will definitely go down on Friday evening so if you are out if you are on decision table then you can just do the modification maintenance everything with a beer or something with water as well but but you don't have to dive into code on a Friday night for sure um yeah and so on top of decision tables uh we have Lisa saying in decision Builder was uh Incorporated in Rome but my notes say Quebec so I'm not sure which one of us is right but decision Builder was added to create a UI for decision tables and I'm going to give us a quick look around at decision uh Builder just because it's helpful to see this as we jump into the script side because this is kind of like the visualization of what we're going to be doing on the on the scripting side yeah decision tables came out before decision Builder so that the table structure was there right decision table Madrid but the decision Builder um I thought it was Quebec Lisa saying Rome but that doesn't it doesn't make a difference it's here now yeah for now it doesn't sleep either apparently not so if uh just to take a quick look at decision Builder I'm going to just create a random one real quick uh you have inputs um that will build the conditions and then you tell it what kind of results You're Expecting and then you build um those questions into the conditions and results and so before I show the scripting side of it that's that's the structure of what we're going to do in the scripting I had to like really think about this because right now the API for it is very um word dense and I had to map it out in my brain to understand what I was doing in what order before we got to this point uh so that's what we're going to be doing we're going to be um creating the decision table we're going to create the inputs we're going to create the conditions then we're going to create the results or the answer elements is what they call it uh we're gonna do all that just trying to get it to work via script and then my goal for this uh episode or series of episodes depending on how this will how long this will take is I want to convert that into a script include that we will post on share or onto the blog so that people can utilize it quickly to recreate the work instead of having to script from scratch every single time they want to utilize this thing the decision Builder API was actually created from an internal request um the itsm team internally asked for an API to be created so that they can create decision Builder tables um uh programmatically via one of their applications and so there are apis right now to create um to call the decision tables and to give it your conditions uh your answer your questions and your answers and then it gives you the result but they're but starting in Utah is the first time they made a API to actually create the entire decision table so that's what we're going to be doing via API so it's an interesting Paradigm because we're using code to create a low code capability or access to a low code capability it just I'm curious what the use case is but you're going to show us yeah so um the use cases are stuff like uh updating the you can have end users update the parts of a table or create new tables um via like a catalog item so um being able to use a record on servicenow to create the decision um decision table that could be utilized by those same end users and for their Maiden insulator so that's one of the interesting things it's very meta but yeah I'm going to be doing it inside this um scheduled job just because I rather not do it in a scripts background uh Precision title API l c h okay um so I'm gonna be going back and forth from the API documentation a lot but I think this is important to see because uh if you go I I found this by Googling it by the way I just typed in decision table API servicenow and it brought me straight here um there's a lot of uh methods within this API and so it's you can get a little lost if you don't have the breadcrumb so hopefully I can supply those breadcrumbs to you right now um but what we're going to be doing first is we're going to instantiate the decision table which um oh this I get to talk about this method um this some of our scripting veterans will enjoy this so uh when we ever haul uh an API within servicenow we're so used to doing new namespace and then yeah um like this and then you put your inputs inside uh he's well you you'd instantiate it and then put input your inputs inside there so uh sequels and then so that's calling it and I'll again for the inputs in a second but the one that you want to look for next is create decision table so when you get into this API again there's a lot of stuff in here but it's not in the order that you would think you would need to put it do it so API then create decision table and then create questions is the three things that we're going to try to hit today okay um so create decision table and then yeah where's the example Okay cool so create decision table and that's where you put the inputs in for it okay so going back to my script I'm going to say DT uh create what is it create decision cable and we're going to put the parameters in there so I get to talk about how to do parameters a little bit better and I like this conversation because it helps people learn new programming skills so when I before I used to um I'm so used to when I build functions your inputs look like the input input two input three and stuff like that an e a better way to do it is create an object and then throw it into your input and then have that be now you don't have to worry about order that's the whole right the main thing so you can as long as you're naming your object uh inputs properly then just react off of the object name object variables instead instead of worrying about order so that's a nice anytime I get past about two or three arguments that I'm passing into a function I'll go forget it I'm doing an object um oh this I was gonna allow I was going to do this based off of whatever last chats were inside of the chat so the name of this decision table will be by Phil's fight that's what it's doing anything so there's so keep the chat going because you never know what my future [Laughter] uh the scope um okay so let's go back I need to make sure I'm trying to remember off my brain uh uh where is it okay we called it and then we want to create the decision to where did it go my drink is so strong I think I overdid the vodka 10 minutes in and he's already lit got the shakes anymore uh so I did name scope and then accessible from is what I'm missing um and that we want to do public but let me make sure I'm spelling it right yeah okay public okay so those are the the three things that we need to put in there and now we can I'm I'm not sure if the script is going to work the first time because you have to make a really long script before you actually get it to work so this is going to be really interesting uh okay so after that we're gonna um uh make the inputs so inputs and an array if I'll show you all that inside um here an array of complex um you need to give it a decision ID which is from the previous one okay uh uh so I need our decision ID equals response dot get no I get the decision ID give me a second does it return it so do you don't you need to create questions I guess like um well we we need we need to have the the table that is being built on though oh okay so like incident uh no no the the decision table that it's being built on okay so where's I I think I'm on the wrong spot I need to create there oh I'm on the wrong okay create so take your time yeah okay here's the record okay it's record there it is okay so response uh record dot Society wait no it's thought get value Society nice or is it get unique value I am I'm sure that would work too [Laughter] I'm gonna leave it like that because that's yeah unique value is tied to a Glide record but who knows all right so let's go back to inputs and build the input well yeah okay let's we're doing this live everybody create inputs okay yeah so the decision ID and the inputs is what we're is going to be the way it's calling it so uh VAR input response let's do that and then we'll do KT create inputs which was create inputs decision ID and input decision ID which we have and we're building inputs now okay Phil is an interesting question when is it get unique value not a society is there any anytime it's not this idea not that I'm aware I'll let you all conjecture that while I try to build inputs fair enough we need that uh that Lo-Fi chill music just to give you a narration break what we can do is we can stick in the note that says hey this is part of our Utah release Utah promos and whatnot at the beginning of the show so good time to do that we have um my bad I forgot to put the logo up okay so um I have I copy and pasted how to build an input um but I know these not are these aren't all required so I don't want to run into more messing up so I'm gonna get rid of some of the required stuff so max size and Order We're Not Gonna deal with that right now um okay we need a name for this one uh and the last comment I'm seeing is Nick that's totally possible it's a string great you just inspired people to make silly comments like they don't do that already I was gonna go with Lisa's YouTube ate my comment um and then the next one uh nobody else has comment since then I'll go up one two I mean oh well there's one that's the primary yeah we're talking about get unique value take the next one no I'm not taking the next one ah as a developer you can control the primary key 99.9 of the time it's a society be cautious if you change it see this is a label we don't need to do underscores right so so um you you might be thinking like oh then where don't you need to add an actual name value to this one but um the inputs column is just it just has a label there's no actually naming it so you don't actually have to have an actual variable name or anything um for fun we'll do this one as an integer Nick in the chat is literally begging you at this point to use the coffee code button on the code Snippets it's like if someone needs to let her I'll know there's a coffee pot oh my God you're not the first one to fall victim to this kind of thing Earl we were doing a scripted rest API there was a link down below it said like run code or show Explorer like what how long has that been there okay we're gonna we're gonna do those as the inputs okay so um that's influence now the next in line was input we did create the decision table create the inputs create the conditions so we're going to do same thing remember this is like kind of like cyclical in the same kind of um structure what if somebody hacked the copy code button and you inject nasty code oh what about someone just like we had an experience where someone hijacked the zoom call of a Meetup yes I remember that what happened someone hijacked something yeah we put the URL for the zoom call in the meetup.com and somebody just came along and started putting like painting dirty pictures on the screen oh no so yeah from now on I recommend using passwords oh that's that's a good use of that Earl got it are you happy now you got it it's dead it's dead all right are you happy Nick are you happy that was one of those guys that my printout didn't come out I'll send it 20 more times it's like a log Jam and it'll just like wedge it loose wait this isn't formatted correctly anymore that is the downside to using the copy button is it the formatting sometimes it can be formatted selection yeah oh my God can't get rid of it now refreshed refresh one second that was fun create conditions oh no that's delete yeah see that would be a bad idea deleting okay does it want all of them default operator is optional uh decision input needs to be the sys ID which is from the input response so we'll have to um play through that which I had to go to the example down here to understand what was going on um to call it is here this is how you call that response you have to know the response Returns the results get the order of which you put it in get the record of that and then get this ID um which is that up there I can't remember let me check actually no no no no going back we're doing this so the decision input for this one is um that's what we're inputs dot you know inputs response dot results foreign looks correct to me at the moment so you just you're mapping your inputs to the conditions okay um we don't need these are these are handed together in decision Builder right in decision tables uh what's another good one from chat right now uh Chris King said The more you know so I'll put that um let me make sure I I removed something and I want to make sure no create conditions I want to make sure it was an optional thing okay default Leaf operator for the condition these are like uh equal sign greater than sign less than sign um for the condition part so I'm just I think it defaults to the equals on strings can you do starts with ends with kind of thing uh let's check or dates before and after I guess those would be greater than or equals kind of thing I don't know it's JavaScript with dating though so that might be a weird filter to do so it does start so you can do starts with you could do ends with like not like is empties uh greater than equal than same as between good the usual songs it's all that you get on a filter when you filter out a list cool okay so do you Rec I love that we're gonna we can't I could press the Run button right now but it's not going to do anything it just it's gonna error out because it doesn't have everything it needs so we have to keep and keep doing this we're doing it live everyone take a drink I wanna we haven't been drinking we've been drinking you've been talking about I polished mine off I'm so warm I'm so glad it's Friday this that's the fun part of my life and cut coding happy hour it's the end of the week and we all kind of just be silly have fun all right so let's go back to the API so we did I'm gonna keep reitering this because it's in my head maybe you want to save your work Lisa says it's time to pull a brad save that's fine incredibly valid okay be safe thank you for asking us for suggesting that thanks thanks Lisa watching out for us so we did the decision table we uh the decision table API create decision table create um what do we do after that and then we did create conditions and now we need to do the answer elements so oh I'm already there okay cool create answer elements and I let me check the example script because it might be the same way create the answer elements and you call it the same way perfect okay so let me scaffold that real quick uh cancer elements hooray and answer elements [Music] response equals PT create answer wait is that what was the name of the thing Panther elements right and then it's that decision ID that we have from earlier and then after elements okay I will press the copy button here copy and then XO let's check what was optional uh Max size order and those are those are the two optional ones so I'm going to get rid of those just to make things simpler okay time for labels are people ready for labeling um label right click in the header oh I love our node okay um wait did I delete something I shouldn't have well there's a classic line from this show I should be part of your drinking game I'm in the wrong I'm in the wrong API hey look I mean there we go no it's fair now the alcohol is kicking in the answer elements should have a variable so there should be a name with this but it's not in the API because the answers are the ones that you actually want to be able to pull later so you need to have an actual variable name in it all right we'll just see what happens without it okay we're gonna do we're gonna try to I'm gonna try to make a little bit more complex on this one um so label is a string for this one and then this one what's the next one alcohol is kicking in reference will Do's so this one for reference this is when you can actually you can reference if you ever change reference a table name this is what is what that's for I think we'll see what happens here um so we finished that one now uh what next is that all no how do I I need to call it okay let me find it in the API oh Talk Amongst yourselves we didn't want to interrupt well now would be a good time to do a promo for knowledge if you're going consider going to Las Vegas May 14th through 18th knowledge.servicenow.com I believe the catalog of items is up so you can start browsing what you want to do we don't have the agenda Builder up yet uh the developer conference inside of that is called Creator con where we will be having Hands-On Labs the hack Zone hackathon evening fun activities lots and lots of great stuff this is one and only one event this year unlike last year that was multiple events in multiple locations at the same time which made for extra fun this will be one and only one event May 14th through 18th in Las Vegas Nevada United States so start your paperwork process right Drew yeah I'm already in the paper process and Shameless plug I'm also presenting it knowledge two sessions tell us about them you better get your visa then yeah what are you presenting on so one is on data filtration that is data filtration your new friend along with ACLs and second one is a special session so won't disclose that unless we are close all right I'm gonna press run do it it's all right execute now and what happened let's refresh this see what happens go the system wait look you have a you have a decision table and it has it has the columns one one input it has one of the inputs okay it has one of the conditions and has one of the results hey that's a that's a good start everyone think we got something we got progress oh mine's empty the other one okay okay let's go so Earl used the copy code button came through [Laughter] uh but not this one you might have to pass out stickers at knowledge that say that or I'll use the copy code button um why wouldn't that work oh shoot hold on uh that Max size should be an integer Adam's optimistic Adam's optimistic he said there's still 20 minutes left this is like old school live coding happy hour where we get to like half an hour that's the Run button and something breaks and we're just like okay well let's go back let's figure we're gonna bump our elbows and skin our knees along with you okay so um I I had something set as an uh string that should have been an integer so I'm going to delete this one that we programming programmatically created you are one step ahead of Adam's comment about you want to delete that now right [Laughter] not again I always do that it's like I created it and I now have two okay still didn't show up delete oh yeah okay delete okay let's look at it wait there's an error here why you know it's bad when the first line of your script is delete the old stuff okay this shouldn't um maybe this so um the hard part is I don't I the there are some validations of baked into this API so um for instance like if you name the wrong scope it will error out to you and tell you what the error is and prevent the thing from being made but if you have a successful in one at least an input and um a condition and an answer it will go through and won't it won't really help like you have to go through a lot of logs to figure out what what didn't go through but so I'm just testing things live hey hey another drink thanks okay cool I'm going to point out another Utah feature what's up see your script editor yeah there the little thumbnaily thing on the side and this is Utah and and if you go over to the line numbers the little expandy collapsy things go over just a little more yeah yeah they're they're supposed to be bigger I can't really tell from here so it was one of those accessibility things yeah now they're bigger thanks can you see it now Chuck but the postage stamp in the scripted window didn't get any bigger I guess it did WOW microphone went to bigger microphone oh and look at here um oh two inputs two inputs two conditions two conditions uh when I fix the first condition the the or the first label of the input the SEC the second condition came through so we're still only getting one that's probably that's probably part of the validation it says hey if you gave me an invalid input I'm not going to build you a condition based off an invalid input yeah that's probably right so that means our conditions were correct it was just that first original input was wrong because so now our answer elements is missing so we have alcohols kicking in we're missing I love our node Phil says the breakpoint is moved to the left a bit he said breakpoint take a drink on the line numbers if you were to set a breakpoint yeah way over here yeah oh it's tiny it's so tiny okay so what are you missing from answer elements so I think in answer element reference is a mandatory field or but it doesn't have to be a reference field though okay um but you're saying well let's look at the Adam's saying string versus string capitalization does it matter oh it did last time it did last week yeah you've got you've got more down below you get a reference in a string or a lowercase as well 36 and 41 I'm trying to line them up from here way to go good eye hit execute hit execute should be fine wait where I don't see a line 41 says type reference does that need to be okay do those need to be uppercase or lowercase I think it's always lower case when you're doing type oh that was that was our problem earlier with the input is I had a I was seeing some Capital strings on the docks maybe that's what's throwing me oh I think oh so you're saying is this I think they're saying that okay okay gotcha an order is number not integer interesting okay so I executed refresh nope hmm where where okay let's okay so earlier this is going I'm entering into non uh documented territory now let's see if I remember this from watching a internal video they had name on answer element so let's see like if there's more than one I think it's a docs issue we'll see I hate to point that out live on air wouldn't be the first this one's four though we're still in early availability for another couple weeks not even out yet so let me execute and see if that was the reason okay that's good that's not the reason what could be going on what's all in the table itself Adam said what table what is he talking about oh um Andrew said if the docs are off he'll fix it nice which is the one that came in correctly for the responses it's one a reference CIS user one that's even weirder create answer elements the answers so we were saying required if the value of answers type is reference so it's not required in for me putting it as a string oh wait look type is capitalized okay do both I have a name and I put it back to capitalize string but then reference yes type as a reference if put it as capital in your I don't think it's supposed to be capitalized might as well just test it might as well yeah literally that's what I would have done if I was actually like coding this from scratch anyways so uh gotta delete this how are you doing on time okay yeah we got 15 minutes so it behaved as a string so 10 was before nine okay so that wasn't it just making sure just that was me making sure everything there's another type right like in Seattle Audi type true false and the date time eek let's try a different type yeah if if one of them worked before do that thing again just to make sure you can create more than one gotta delete the table again sorry everyone that I'm flashing around tabs so quickly it's like this table is going through Groundhog Day like it's born and then it does it gets more oh you got that okay so integer was working I just couldn't get string to work properly oh is this why does string have to have Max size number oh that might be why on our on our let's go everyone has it let's not let's not leave it unaccounted for thank you and this was not originally there so that's awesome do it also this is kind of bugging me let me go back up here and call it capitalized F fight before here if you're making notes at home the type is case sensitive we're about to find out from exercises Max size is required there it goes yeah back sizes Max size for Strings Max size is required yeah Max size that doesn't say that explicitly here true yeah it should be safe if reference this should say required if string that's be everyone's take home from today well they like take away key takeaway points Max size is required for strings in the decision table takeaway point was what the docs aren't 100 accurate so um that worked we did it again no now we have to put in the the con yeah we got to do questions and answers okay so let me let me ask you all what do you think because uh I don't know if I could do that in less than five minutes just do one just one row can I think just do one roll Okay so this is actually a new script um Phil max value 4000 is a lie that's why I was trying to click on it someone else I got it we hit it like within microseconds of each other dude that happens to be all time I try to share these comments someone else will post one then I'll click when I was trying to join on camera and Earl was trying to join me on camera I was like I'm there oh all right so create questions you need the the decision ID which is the cystic okay so that's if I'm doing this in multiple scripts that means I I'm going to hard code this for now please don't let me ask me for that hey what was that going on over there hey hey [Laughter] so we I got this this ID from um the decision table it's up here in the URL uh from there we need to um do what we did at the beginning of the last one and call the API decision table like that there it is then there'll be questions I think that's Brad saying that now yeah so you build the questions and then you call it okay cool for our question equals array and build a response which let me go copy one the spirit of Brad is infected oh man it's because I've messed with Brad so many times on show Karma comes back what is this uh condition is what you want it to be as a query so the conditions required to reach this query the fields available for the conditions are the inputs that are associated with the distance table okay so um that doesn't actually explicitly say it but because I'm going to check down here to show you all where I got this from right um see the condition it's a query that's how I knew it oh an encoded query string sure yeah an encoded query so I'm gonna um simplify this and just say what is number no what would be an easy condition to what what was the type the first one was it a number of the table no that's the the point we have a string and an integer right yeah it's a string oh we can't just yeah doing one is doing the whole thing okay we're gonna have to do two so just do something simple like number equals zero okay it was a string yeah string interesting how do you address that variable the the the input yeah I'm thinking it should have a name right but the name was a label yeah might have to fetch it from the table I guess like yeah ID that's hard-coded first make it work I like where you're going with this get into production later first get it working then make it pretty okay let's do the easy ones first so active should be true because we want this to be working this is active as if it was right there's a check box somewhere right yeah um the so that's active answer default answers default answer required I like that indicates if it's the default question for the decision table so that means something needs to be true and something needs to be false which makes it easy we can just pick one order I'm just gonna put whatever now back to condition is anything happening in chat to help no why are you posting snowmen they're working on the uh a session stack variable question no I'm we're just let's just copy these ones see what happens okay all right so we can get something in let's run before the time Runs Out it's an answer is just these but we have two answers so we need to do two for each actually right and what if if we leave one as blank I guess you could yeah um and answers were string and reference oh shoot okay hold on let me go grab our best friend Abel bubble able okay so the second one should be uh second one should be reference I guess first one was string it was the name of the I think it's supposed to be the name of the variable which we never gave it one right that's what I was asking before how do you address this thing maybe it creates a default based off its name it's label I'm gonna I'm gonna guess it's these things with understanding or Nick that's totally possible thing maybe well no no I love Arnold and then this one will be alcohol's kicking in all right and then you need that in your condition also the last thing I see in chat uh you know we could have just asked chess chat GPT to write this for us and we'd be done by now [Laughter] did you stay until 2020 and I believe it has come afterwards oh my gosh it doesn't know anything past Paris dang okay so great questions uh decision ID and then uh I know we're not actually using it but I'm just it's I'm so used to doing it like that I don't know if this will work we'll see what happens welcome to the end of the episode let's see what happens all right so I'm going to refresh this we can leave them on a cliffhanger I was hoping it would work oh okay just real quick let me see if I did what I if I could think of what I might have done wrong that's a fiddly you won the score on the name maybe that's what I was thinking if that's the reason why I'm going to be so annoyed it might be because the condition is invalid at this point oh okay should we just wipe the condition and just make it always true my help we'll try it no all right we'll have to do this another time hey we got somewhere though we could meet the tape we made the table at the table me and puts yeah and your dream of taking one progress of one to another live coding happier is a success that's always the optimistic way to put it I guess all right let's I mean we we got the table up so um I'm gonna clean up the code uh post it somewhere or I might just wait for us to convert it to a script include and then do it from there and then post it uh but hey thanks for joining us for Life coding happier like that's kind of how it actually goes right we sometimes you win sometimes you don't we got a win we got semi-progress on another thing I have a script to debug at this point yep quick announcements we already talked about you gotta read the drinks too oh we gotta rate the drinks all right quick announcements then we'll write the drinks then we're out of here uh lots of meetups coming up I think we mentioned this earlier we've got Delhi in a few hours from when this is being recorded there's also um Orlando Stockholm Denver Phoenix Oklahoma City Pune in a couple of weeks check it out meetup.com Pro slash servicenow Dev program I think it's actually devilink.sn Meetup so go there check it out sign up for the ones that are in your area we are doing a lot more that are in person now too so that's always fun don't forget London man don't forget London I didn't see it on the list did I miss it it's a few weeks from now and Vancouver is going to be listed in a few hours because I got a call right now with them uh there you go and while we're on it still we're opening a whole new chapter so if you live in the Philippines keep an eye out there's a brand new chapter in the in Manila kicking off at the end of the month as well so all right rate the drinks Earl are you capable of coherent thought um smooth um I would uh uh a four that's good it's really good um I probably got a 20 down on the Vodka though for those that are new it's four out of five on a quarter point scale so we're using the untapped method it wasn't four out of ten so four I would say 4.25 because we usually add 0.25 if we had success we had some success Okay 4.12. order point scale don't don't mess with the people four Lauren how is your milk tea I will say it's also a four it is just a nice staple of my my drink catalog so nothing special but always Pleasant and drove how is your water out of your MVP water bottle so it it's four it could have been five if it was warm if it was warm you like you prefer the warm water I was looking at the weather yeah oh if it was warm outside I think you wanted the water one look at the weather Warm okay I'm with it and uh my Kona longboard is a good go-to beer nice lager if you're into loggers I'm also going to give it a I'll give it a four and a quarter it was it was easy crisp We'll Wash down pizza and tacos just wonderfully even better so yeah I'm looking forward to that soon you just look at your topic recently watching your struggle will really help me I saw that comment from Phil and I had to show it off all right that takes care of him for us we wish you all the best stay safe we'll be back hopefully next week with another Utah topic uh it's kind of on the fence right now we're working through some technical issues so if we fix them we'll show you if not we'll go to plan B so what what's your schedule for that again you go to devlink.sn slash Utah for a complete Utah content calendar for everyone that's here I wish you all the best and safe coding everyone take care thanks everyone bye everyone bye [Music] thank you [Music] thank you [Music]

View original source

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