Integrating with wifi thermometer for a cooking application - Live Coding Happy Hour for 2020-07-17
[Music] fun hello and welcome to live coding happy hour for july 17 2020. um we're glad to have you here today we'll go ahead and jump right into the introductions and starting with brad my name is brad tilton i'm a developer advocate with the developer program here at servicenow i have been developing on servicenow for about 12 years as a customer partner and now employee and i am sitting here sort of outside but not really because outside it's 100 and inside it's less than that and you're chuck hi i'm chuck tomasi senior developer evangelist at servicenow been here for 10 years customer for a couple years before that and i'm not going to go into the years and years decades before that at this particular point but i'm really happy to be here i like brad's background he's gone all out for this with the smoker thing and you know if you were here a couple weeks ago you got the start of this project well we're gonna be digging in deeper for it so very excited to see what comes out of this awesome thank you chuck and i'm andrew barnes also developer advocate here at servicenow in our platform business unit uh been uh it's coming up on years like i've almost hit year six on the platform uh i just was thinking about it the other day and i was like huh i've been saying five a lot it feels like it might be time for six and it is um it is next month time for six um and i specialize in integrations uh custom apps and uh you know large-scale development teams um so we are going to do some live coding but before we get into that we're gonna introduce the our uh companion that's on the show which is our tasty beverages it's a happy hour after out after all brad yeah so i was running low on time so i i did not get to find a summer beer so i'm i'm rolling with the uh the dragon's milk stout again which is just wonderful and i had one in the back of the fridge so oh darn you have to nice and you chuck it's not like you got to go to the refrigerator all that's here is bud light and miller light [Laughter] which is fine if that's what you like that's what you like drink what you like uh let me see what i got back here all right all right bartender served up right i've got the moosehead grapefruit rattler that sounds a nice summer beer i sent her out for a rattler she came back with this i've never had a grapefruit rattler so this'll be interesting uh so i've got a carrot red imperial ale by someone i don't know by who somewhere on here imperial yeah dangerous always when it's a double or an imperial eye watch out [Laughter] uh so i'm excited about that so um as chuck alluded to earlier um we did have a show that we did some architecture and data modeling on for this uh cooking app three weeks ago the link is in the description below if you haven't seen that episode you can watch that and catch up um and uh today we're going to be continuing on in that vein and brad why don't you tell us more about what you're cooking up sure so uh to the developer's kitchen [Laughter] so we did the week before was that three three weeks ago we did yeah that sounds right because we skipped one three weeks ago uh we built the data model uh for a cooking app uh so we wanted an app that would manage uh cooks and recipes uh and you know what we do during a cook with you know my focus is really uh smoking meat or vegetables over a long period of time and so i want something that i can kind of track how that goes and then i can look back on later and we have all sorts of enhancement ideas for this app but the one that we want to focus on today is integrating with my wi-fi thermometer so that i can automatically pull some temps in to our app nice and i was going to join in on the fun today but uh one i've got a storm that's cut my power off several times today and i forgot to take out a meat so i didn't have anything available i thought about it too late last night and i was like well i guess uh brad's gonna be smoking alone tomorrow so yeah so that is my smoker behind me is there anything else we want to cover before we drop into the share on that on the vein of uh catching people up uh i don't we'll do a quick review uh when we get into uh the app on the screen share here uh so yeah let's go ahead and get going there all right let's do it you have disabled attendee screen sharing though could you enable it i gotta change that default setting for this there you are sir it's working it's wrecking this should be right i say that a lot when i write code this should be right all right let's see this should be right do i need to zoom in a little bit are we good maybe a little bit let's go once how was that i'll take one more if you got it it'll be 125. let's go one more time yeah that looks pretty good now all right so we'll go ahead and start in in my instance here with my cooking management app that we built a few weeks ago we have a few different tables in here and i've added a couple of tables since then but we have a cook table which is kind of our master table where we're we are cataloging the recipe what kind of food we're cooking what we're cooking it on what kind of fuel we're using and then we've got some other things over there as well and then something i added was this log table so today i am i am actually currently cooking a pork butt that i started uh at uh what was that a long time ago 6 40 this morning my time um so that's nine hours ago so that has nothing to do with the fuel you're using log does not necessarily have to do with the fuel i'm using but yeah the smoker thing i had to make sure oh man i feel like the puns are going to be prolific today oh man we're drinking um yeah so i've got this log table and this is what we're going to kind of focus today but um so i've got a time stamp a category on what's happening and then i have an image field that i added where i have taken some pictures which i don't i sometimes take pictures during cooks but it's actually kind of helpful to have pictures associated with time stamps and so today i was very diligent and anytime i did anything to the smoker i made sure and logged it um so we've got you know i may have you know stoked the fire added wood to the fire and i tried to take pictures of the pork as i went uh and then i wrapped it right before the show started so are you how are you i feel like this i feel like this is really in need of a mobile i was just it is absolutely in need of a mobile i would love to be able to snap a picture and then we're going to snap a picture and set a valley and it does this all right yeah like that's that's on my calling out for this so much yeah definitely uh that is definitely on my enhancement list uh for this one uh so so we've got this uh and we've got some other tables here recipes the source of the recipe um you know who wrote it uh my i've got a i have a weber kettle and a smoker and i use both of them a lot and different kinds of fuel so we've got some different sources there on the left of uh info coming into this but the cook table and the log table are really our two main tables here so question um uh i wasn't here for the original show when you're creating your log entries uh what's that look and feel like yeah so right it's not a traditional log where it's just recording the action somewhere else this feels more like a you're creating entries there directly yeah so this is a new table uh where i am coming in and adding something okay so they're they're just records you're creating directly they're not records you're getting from somewhere else right now at least that is correct and you know i think so right now everything about this app is is uh manual and the goal is to make it more and more automated as we move along here which is goal that's not a bad evolution for an application yeah start with the manual process what your process is and where those automation opportunities are just so you've got a the data centralized and scalable and everybody's you know looking at the same thing and you can make some quick reports then you go all right what feels manual about this i i've done this over and over and over again don't let the barrier to entry be well we have to do a process map and we have to find out who all the stakeholders are that might be fine if you're working on a grand scale across the enterprise but for you know little departmental things like this just get it in there and start working on it yeah and finish defining your process since this was a new sort of uh from the ground thing there's value to be had just by getting it on the system awesome so what's on our agenda for enhancements today brad so today what i would really like to do is i'd like to get some temperature data in this log and i have temperature data uh and i don't want to manually type it in because already yeah typing in these four things and adding the image is really too much so let's uh let's automate some things so on that note i do have a wi-fi thermometer my particular thermometer is called the fireboard you can see my uh my smoking session for the day uh started around seven and uh we're here at uh at four and uh so we've got it's obviously capturing a lot of temperature data here uh you are hovering right at that 170 bubble i am i just wrapped it so you can kind of see where it went down a tad here uh if you can see that but so i wrapped just before we got on the show to kind of speed that up because i would like to eat dinner tonight and it means we got to be at 200. so that's uh that's why yeah and and they hang out at that 170 those those uh pork butts hang out there for a while yeah yeah it's when all the that's when all the good things are happening the fact that it's rendering and turning into liquid there's all sorts of stuff that happens that that's so true and you really can't rush that stage too much because then it doesn't it defeats the purpose that's right but when you're looking at your charts you're like oh man i wish this section would would get on with this business except for it's doing it it's doing its business that's why it's staying at that temperature because it's getting stuff done that's right um so cool you you've got this place and they've got an api they have an api oh i had the api open yeah oh well well let's uh let's find the api uh so they do have this api that's going to let us it's going to let us grab stats uh from the thermometer nice uh i was just here ah here we are so what's your what's your plan do we want to do this on a interval basis like every five minutes just get a log entry or what are you thinking of of how you want to attach to this api so i'm going to want to do this two days i think today what i want to do is every time i have a log entry i want to go grab the associated temperatures with that log entry which is we're going to need a place to put that that way you're logging in overloaded with 99.9 temperature readings and every once in a while you have a picture of some meat uh there it is there's this one link that i always forget where it is all right so this is our api um so let's look at the api and then we're also so i don't have a place to store this data yet in the app and i wanted to discuss that because there's a couple of ways we could go there but let's look at the api first and and it'll tell us what we're going to do so it's a token-based authentication which i already grabbed a token that we'll be able to use and then there's a few different things that we can do uh once we have our token uh we can get some information about the device and this may be what we want to do um so if we uh if we grab info about the device then it'll give us this latest temps attribute which my thermometer has uh six different uh ports so it should give us temp attempts on the six ports uh i typically use two i usually have an ambient temperature that i put on number six and then all on the meat goes on one or one two or one two and three your meat thermometer is schwanky six port pro you know ports for probes that's a lot so do you do you have a device table and i'm thinking down the road you know you might have two or 17 of these things that you want to say hey go get the temp on this one and then go get the temp on that one that is a good point maybe i end up with a bunch of smokers and a bunch of thermometers and uh i want multiples but no i don't i don't have a device table that's a good idea um so right now how are you going to say go get this you're just going to i mean i assume the api needs some sort of need to take that id okay yeah so i've got i have the id uh that i just grabbed from the account uh that i think we'll be able to use brute force so i think that'll work for now but i i it definitely needs to go somewhere whether it's a property or even better would be a device table all right so we have this device properties i can list all devices and then the other one is the session itself and so the session itself will give me i believe uh i get a start time and i think this is probably an end time not a start time yeah it says configurable in time for the session yeah i can't imagine that a place would have their documentation incorrect but so you know we've got different things here and then i think i can get uh yeah session data so this is an interesting one i don't think we'll use it today but i could grab you know the overall uh data for the entire cook uh if i wanted to here and so this which is how they generate those the chart that you were looking at right is is this session data yeah so maybe an array of timestamps and temperature values which is what the chart is yeah nice um so yeah i think the first thing is we need a device table and then we have to decide how we want to store the temperature returned data um yes [Music] i'm noodling on that one so my first thought was just adding six fields to this log table and then i thought ah that feels icky to me so and i may have another device that doesn't necessarily necessarily have six probes and that it feels feels very rigid if we were to do that um so let's uh let's discuss while i go ahead and create this new device table yeah so why while you're doing that yeah i'm what what's reasonable for a single cook which is i want like how many temperatures do i actually ever like what's the maximum number of temperatures that i could possibly want for a single cooking session of a thing feels like like three is probably the most i want so i've done four like in two spots in the meat maybe i'm thinking what do you what do you want to do with this data what's the output what's the end result are you going to be looking at it on a list is it going to go into a report you're just going to store it for statistical reasons you're going to average these up what do you want to do with that information what a good question um we figure out every related list is it good is is is it a name value pair field i don't know you you got a whole bunch of choices that we could do on this and that's sort of the natural conclusion of any time someone asks for a report i go what do you want to do with this data or or how do i how do i add this field what do you want to you tell me what you're doing here what's the business requirement what's the driver what's the output your input the temperature of the meat right that's that's important for knowing uh you know what's going on with the uh you know if you need to to do anything and have steps that are at particular temperatures of the meat the temperature of the cook box is important because you need to know when you need to go add more heat or damp it down even right and then what other temperatures might you need four what were the yeah so my my smoker has two shelves in it uh it's got a uh a top shelf and a bottom shelf and they actually run about uh 30 degrees different ish it kind of depends on i think if we're hotter that is larger and there are times where i'm actually cooking something at a hotter temp than the bottom one uh so it's helpful to know i don't i don't always like actually need that because i'm you know you can't really maintain them separately so they're you know they're just a little different but it is nice to know both of them and then uh i only actually have two probes that go in meat so i've only ever done two ambients and two meat probes but you know if i'm cooking like multiple pork butts in there or you know if i'm doing a brisket i'm gonna do you know there's there's two different muscles on the brisket and one of them is more fatty and they they end up cooking a little different so i want both of those um but it's you know i could do a whole bunch of uh a whole bunch of stuff so it feels like you need a probe entry and you relate probes to a cook session so a probes um like number of probes on the i created this thermometer table um yeah so a thermometer table right and then that will have the temperature and then you just update the entries on that because the thermometer is the device sorry i got confused i wasn't paying attention when you were creating the table i thought maybe this was yeah so that's the that's the device you're using i was thinking of a probes table is that relates or a temperatures table that has a probe and a temperature and a time yes i think that and then i relate those two sessions of cooking so it's not related to thermometer yeah because of log yeah i think on the thermometer i would just want to know the number of ports that it has because i could change everything around and you know it it really doesn't necessarily correlate to a specific probe um it's a network gear so let's give it a ports are you a fireboard certified technician i'm definitely not all right so and then we'll create a is it a probes table or just a temperature table no i think it's a temperature table and it has probes which are a port on a device you could almost relate that two ways you could go back to the device to say i got this temperature from this device on this date for this session so it's almost got to have two two reference fields you could almost i don't i don't know how many to many would be appropriate here but it seems like it's got to have two references because you want to type back to what device that temperature came from yeah i would want it to tie it to the device and to the cook or to the log the log entry so you're going to when you do a log entry it's going to it's going to trigger a business rule or something that says here take the current record which is our either the current log entry or the current session the cook session entry and then you're going to go get your readings create those in a table says this probe is at 212 this probe is at 172. this probe is you know whatever and and you get that information back so you've got your temperature reading you know what probe it was on so you know what device it's on and you know what log entry it goes with i think having having more relationships in here is better than trying to reduce the number of relationships yeah yeah i think so let's say we're gonna have a log reference to the log entry are we are we in agreement at this point no yeah no yeah i i thought i might get a no from andrew uh what uh so so this is the this is a single temperature at a single point in time from one which may not be a log entry okay he well his initial requirement was that he wanted to when he created he creates when he has a log entry okay he wants a temperature reading otherwise but he may not need a temperature reading uh or he may he may not need a log for every temperature reading so there could be it's reading temperatures all the time right but we only want to we only want to like action it in the we want logs to be sort of actionable right right like we've taken a picture a snapshot we've added wood we've like those are the a thing happen and a temperature is a reading that's constantly happening all the time do you want a bit flexible enough that it's detached from the log entry you could just say hey you know what every hour i want a log reading i mean i know into temperature reading what the hell you don't have a log depending and i think i relate the log to the temperature not the temperature to the log um are you going to have a temp i may have six temperatures for one log yeah that's why i didn't make multiple fields on the log entry okay so it it's fine for it to be referenced but i just don't expect you to be filled most of the time maybe not later but initially definitely yeah i think initially the only way we get a temperature because you're you're building it from the log and into one right by doing this so you're saying for a given log go look to see if i've got any temperatures and that's fine that's fine yes but i do see i do see your point where at some point i may want to just grab like i may want to temp every right if you're if you for example grab all of the stuff from the session so you can build a chart inside servicenow most of those aren't going to have log references they're just going to be temperatures and time stamps i don't think it's critical that they need them but i think it's beneficial log entry there so you can relate it to a log a point in time yeah and i'm going to go ahead and throw a reference to cook on there and that'll give us if we did want like a relation a related list of just temp entries we'll have both that would make a lot of sense then you could do a scheduled read and it almost feels like the sc ask has a request and a request makes me so unhappy to have both of those there i know it's it is fairly redundant but i i do want to tie a log to the temp because their timestamps could be a little different but i still want to know like which log entry grabbed the temperatures and i don't know of any other way to relate them yeah i'm i'm not stopping it i just it makes me unpleased does it also displease you that sc task has a reference to sc rec item and sc request yes i mean that that's reporting right um yes i am consistent in my grumpiness on on these things uh so one of the things we're gonna get back is let's let's look at what do we get back here oh it doesn't really tell us uh an array of the latest temperature readings i think it's going to tell us which channel it is or which port it is yeah i expect that array to be six long for your device yes um name that's gonna end up i think we're gonna calculate a name and then let's teleport yeah so you're gonna want ports right because you'll get six of them and you'll need to store them in separate entries yes i just put in a json string you're done with it i want i want six really because that then you'd have to parse it for any time you want to do anything with that data i just were you making joke i'm just kidding the only time i start json is if i could really is if nobody is going to be looking at it like it's an interstitial stop gap to be an import or something uh mark has a really good uh youtube pawn on the youtube with too many cooks in the kitchen yeah he does like i needed to call that out for her good job marks i'm glad that storms pass me by and i'm not gonna lose power again now that the show's actually running i lost power like four times right before the show so i'm delighted so i'm gonna add a related list here for our temperatures just so i'm just here for the comedy too mark all right i think that is everything that we need for now i think we have a place for everything right i did some pork chops the other day too all right so i want to make sure that we actually we actually get to uh connecting to uh the thing yes let's do that we should probably get to that are we doing a custom spoke yeah i i think we need to start with an action probably do you want to put that fireboard stuff in its own spoke or you're making a part of your cook app spoke um i'm gonna make it a part of my cook app or we'll do it in global what's what what pops up nice and uh upside down andrew i definitely have ups's which is why i didn't lose connectivity through any of that so uh but they can't run you know i don't have a generator so i can i can handle blips i can't handle out for an hour that's not a thing let's go fireboard so all of my internet and my my desk is ups what is the standard naming convention for an action that's gonna be calling out to something uh uh well first you don't call it fireboard because it should be in the fireboard spoke but anyway but he already elected chuck already but you already elected i know i was there but so you put fireboard all right we can do this right let's do it right uh because you might actually share the fireboard spoke with someone else who doesn't need your cooking app that's true and in fact i'm now going to ask you to share your fireworks smoketoberfest that is separate from your cooking app and have he's gonna have one in the bank for spoke tober fast yeah let's create a role yeah just click continue in studio advanced like a like a like as a true developer oh no it's not going to work mistakes were made there we go now we've got it uh but they had flow open already maybe not oh yeah this one gives me a flow in a new window huh yeah let's do this yay a new flow flow or a subflow right i'm into action it's fine yeah now we're in firebore's food and so now this should be descriptive of what you're trying to do like be descriptive of what this action's going to do uh so we want to keep we are getting device in so this is basically what are they called this yeah device properties is going to give us the latest attempts um and channels there was a list devices too would you want to periodically list your listing [Music] now we're not building that we just want to retrieve known ones yeah okay device properties device api but don't you send it because like we do so this is going to be which one are you actually going to call we're going to retrieve this retrieve a specific device yeah what's let's call it device information like git device information i find myself putting like that a lot of actions though and it gets a little mind-numbing to just say what yeah device information yeah i've i've if it's more than one i'll do a look up something if it's one uh it i don't know yeah this is this is something i've been struggling with the last few weeks as well is how do you appropriately name them because yet many many many of your integration things are either get or put it's like that can't be the prefix for all of them we're i think we're thinking http method too much on i mean but that's what my action is doing so i i know i know if you abstract it so your actions not doing it getting her put then i think it's actually doing a i think it's actually doing a post yeah um yeah then it's it's a gag all right um you can label it later but you can't rename it it does the same thing as tables you're true action name is your action name forever so for all time until you edit it by hand uh so we are going to get a device id and that's what we're mandatory because it's not useful until you do that save and test [Laughter] just say save and test because we're not yet at the test stage zero steps come on all right gotta get an early success honestly are you doing test driven development i fail first and then i said then i start building oh i didn't i died come on oh oh that's awful now we're disappointed that is a that's a fail that's gonna take a big time to fail just to activate that oh all right um i'm gonna get you integration hub loaded you go finish uh we need modeling and putting those related lists on the uh i think i need a connection uh probably for this right nine zero seven nine four can i create a connection for uh fireboard the chat is cracking me up all right work done no but we're 90 agreement on a column name [Laughter] that's that's about right i mean 90 is victory yeah um what color is the shed this might go away we need the shrubbery no i think i'm gonna be able just to paste in that looks like the right amount to paste when when you do your connection and you do your resource path where do you leave that slash do you put it on the connection or do you put it on the the rest resource path that's a great question uh i look at it and i start on a slash is my policy i like that because i end on not a slash because i'm not sure something will come after it and if i add something after i start with a slash but if you have a slash in your name and you accidentally put one into the arrest the path it won't hurt anything double slashes and urls are ignored yeah i just paid for their naming policy i gave them that's the actual attack you are technically correct andrew you answered i might not find the answer i do but what's yours slashes everywhere yeah i i usually leave the slash in the connection and then leave it off of all the rest calls okay all right i think i got all this created correctly i wonder if we have a corporate standard we should probably ask josh i'm sure there's a there's a standard upside down andrew says that uh that uh integration hub automatically removes and slashes oh wow nice to know i wouldn't be so confident we have corporate standards all right if i do a refresh i mean it's still it's still loading so oh i mean i've i started it it's going what's getting done yet integration so what if we pretend like we know what we're gonna get from our oh no all this uh all this action's gonna do is make our rest call and then we're gonna want to do something with it and can you can you fake it with like b scepter or is that too much work uh we could just i mean b scepter won't help you add a red step here oh yeah well you could curl it without exposing your uh authentication token uh i can but i suppose that's sort of academic at this point yeah so if he wanted to go retrieve a thing he would use the postman right now not b ceptor oh yeah you're right you're right b scepter would be if we had integration hub but no target right um it's loading it's it's it's getting there it's close so uh did we you set up your credential already i wasn't i did i i think i may have even done it right which would be great but i didn't set something that'd be fancy and we we have where we want to store it and how we want to store it which is a time stamp and a um why don't you look at the time uh and see if we have to do any conversion and work on that problem because that's always that's always a time waster for those of us that were laughing at the chat room where are you you put in what an api key or what did you put in for your credential i put an api [Music] yeah i have an api key in there okay so you're using that as your authentication token that you got back from yes i already grabbed the token uh yeah good i did a little bit of pre-work i love a little pre-work not not the right pre-work to activate integration had to be done anyway uh so here let's see uh oh i gotta reload well yeah it wouldn't even show yeah if it did so it's like toilet paper it'll get used eventually all right almost uh i'm watching the indicator go by i'll let you know when i when i think it's ready anything is watching status bars go by uh so let's go add it on the form like let's go see how we want to look at the temperature things from our log and or from our cook so we can do that right now can all right so here's my log what i want is i want i want some temp data i kind of want it in the column here um but i at least want to be able to see it uh correlated with you so if you have multiple temp datas for in a log entry how do you want to see those do you want to see those as an array you could do it as an array you could do it as just a string up here that says you know temp pipe temp pipe temp pipe i mean for glancing at it like this because we haven't put anything in logs for temps yet so we have a reference from temp to log right and so you've got a m2 one that you can show here but you can't see that in the list view of the logs on the cook yeah and i think eventually i'm just going to want to look at this on i'll probably just want to look on a chart and see all right this is what my attempts did you know right now i can look at this chart and see you know here's where everything's at yeah but i would love to know ultimate response i like that embedded into your cook session right yeah like i want i want to attempt to to be direct like i want to know which temps are actionable on the cook that then kick off things sends you a slack message time to throw a log on the fire yeah i that's what i wanted to do is i have some create a log entry poked breath put more fire in me light a fire under him so we did associate uh we did associate let's go double related lists and we'll just make andrew cry here we go i need a good cry this week this is a really fun use case brad i mean you've got a lot of data modeling and we're having some great discussions that you have to go through for every app yeah there's a lot of use case it's a lot going on all right so i think what i want to see on my cook is i want to see the current temperature on the look like at the top of this so i want my log to show me the last thing so i want i want to see uh the newest i basically want to activity log not a related list i want i want to see the last thing that happened and i want to see the relevant temperatures right here a journal field a journal input field might be interesting here brad your flow could do yeah well boom here's your temperature readings you could still log them to the related list but you could also into an activity you remember when we extended this table from task kind of randomly additional comments there we go wow that was a good call [Laughter] thank you former sober us all right well i think initially we want to we want to go ahead and populate this temperature table yeah with some temperatures the temp and the thermometer and then we'll kick it off from a log so we'll know that and well it'll have the cook yeah mm-hmm because i don't know that let's put a couple in there like fake a couple all right you know what we can see we can see what it looks like let's see let's see what it was around uh what was this i got 245 all right so at 245 which i think is right when you showed it to us we're at 242. yeah we've got 212 6 and 172.8 okay so you guys remember that 212.6 178. all right uh i'm going to make this some sort of calculated field what's the first one 2 7 2 12 2 12. 276 did not sound right because then we have a problem and this was actually we're gonna call it i think it calls it channel six and uh okay and then we need to pick that log from that time do we have a thermometer in our device table yet um we haven't populated any thermometers yet oh yeah that'd be a good idea what was it 245 240 more or less i thought yeah well we'll start there you made it in the field that's my fault just make it i make everything in the integer field all right so well then then you round it it's 212. uh not for brad he's cooking with chris here goes your precision uh all right let's uh there's one what was the other one it was uh 176. soon i'm going to get you to install metric bass and no no i'm not um by the way flow designer is done and ready all right yay use translation on the temp field so it's compatible with normal people do i have to get totally out of this 212 100 yes that's the easy one flow designer does a lot of floating stuff at like pure start load time yeah that's why it takes a while to start up but yeah doesn't have to do a lot of that stuff on the fly actions every list in servicenow should be sorted by updated just automatically automatically and yay so we're going to use a rest message fireboard maybe that'll work uh our resource what's your resource path let's do some tap switching nope that didn't do it all right uh oh yeah we need our device uh what we need to do is we need to go populate the the uh our table uh when i created that table device id populated in there right yes you don't have your device id memorized i have it in a different window you know what we can start with we'll just start with the actual device id which i have copied oh yeah and just plop it in there yeah and say slash device and slash paste just just to get a just to get a thing rolling yep you need a device in there device says flash devices yeah uh oh did we get a uh did it give us the resource path yep it gave me the base but here we go yeah yeah you need slash devices you need slash devices should i spell it right or no no definitely not ends we have our newsletter discussions somebody's typing and somebody's talking and neither are we getting it right uh and then we have temps dot no real time temperature from device this is actually not the one we were gonna get but that's kind of the one i think we want yeah let's get that one let's set this one because that's the one we're going to call when we want things yeah okay temps.json uh so we need to give it i think an authorization header reading i believe right that was what it authorization and then the token and then you drop in uh token colon and then you drop in that credential value i actually put it all in the credential value you put in token colon i did in the credential value cause you described the device id token space yeah generally you wouldn't put that into your credentials you would not yes and you grabbed device id not the credential you are correct andrew again we'll fix that on uh and post yeah we'll fix that in post sorry fix it in production all right so i think that's all i gotta do all right let's we can execute that then let's let's see what uh kind of interesting we get uh device id we yeah uh we didn't we didn't even use that input that's okay we did not well here you can type it anyway you just say bob it doesn't matter i'm not using it uh attempts.json good thanks bob thanks bob let's see if it works completed oh no error [Music] hey 200 that's a nice number that that'd be great 188. look at that 188 nice this was both successful and this looks really good for my timing yeah you can actually dinner tonight yeah like i think we've all written the function so we've got channel and then a number and then a temp and then a number nice i like this and the time format looks nice easy to convert that's that's your fahrenheit ourselves yeah shouldn't fahrenheit be number one i'm just kidding wasn't that was specifically for upside down andrew and any of the other people with reasonable numbering systems and things in the world everyone else which is pretty much everyone else all right uh that's that's that's some gold-plated victory right there do we think in five minutes integration hub and we got a correct response back we're getting an extra quarter point on our beer ratings today yeah my beer is getting some victory points today uh what what do you what did you say what do you want to do in the last couple minutes here should we try to write this to a record it's going to involve i'll be able to parse it should we wait and parse it in a couple of weeks i'm feeling like that's not reasonable in the last couple of minutes i think that's right yeah that feels like more than a five-minute offer i think this is i i'm comfortable ending on this victory well actually you know what as long as you just go and put your device from the input into that thing yeah let's do i'll end on that so let's take i could go in your flow i could do it oh yeah uh in the action you actually you know instead of hard-coding it you drop in device yeah watch we weren't paying so much attention the device actually has the token space in it all right so let's try this again um and oh should i save it maybe save it i i try to just always save everything and yeah all right this beats the old scripting method by a long shot this is victory victory has been declared all right you can stop share i will stop sharing now nice work gentlemen that that was that was a good victory right there uh so i'm sorry we didn't have integration hub installed but we but we got it done and installed so the things we did today we you know extended our data model some because we had new requirements right we had a nice discussion around how we actually want to do that and there's still some refinement i think we can do there and you know we just are overloading it uh for now until you actually figure out how you want to use it and so once you start once we start getting some data in there and do a couple of hooks and decide you know one how you want to action this data and how you want to use it potentially later to do some you know retrospectives on should i have done something differently along the way and adjust my process based off these temperatures i got and the results i got that the previous time because you you know you can compare and say this cook was awesome and this cook looks awesome awful like that but it wasn't the same let's figure out how to actually get there um and we're going to license this all to famous daves [Laughter] and and i think we've done you certainly have done a reasonable data model for getting us uh close to actionable stuff here uh brad and chuck you all did a good job this the first time and even today pushing on the connectivity issue um appropriately so uh so it so it felt useful and good uh and this is a fun topic like this has been this has been enjoyable everybody wants to know is the pork butt done yet i mean it's it's pretty close like yeah we're we're it past the plateau so it's well on its way it needs to sit after we after we pull it it's got to sit for at least an hour so you're you're a blip that's the hard part put a picture in the sn dev slack channel somewhere i i definitely will yeah um so anything else that we learned today specifically um nothing's jumping out like a fairly simple api um good rest response easy to parse we should be able to get that yeah that that's super parsable uh and easy and they didn't do anything wonky with the date yeah the time is your typical what do they call it t time yeah z time in fact you know if if that's the current time brad you don't really need to save that that's your log entry we created at that point you get sys created for that api yeah yeah that one's easy because you don't even care it's it's right now time yeah for the other one it'll it should still give us that in the same response tight it is my expectation so those will be easy to parse but yeah good point chuck that you know we don't we don't even need to worry about that okay here's your reading time time same time the record was created every time i'm not opposed to throwing away a few parameters if i already got that information somewhere so we got we've got our temperatures from multiple probes uh from the device and we even have an architecture that could handle multiple devices with multiple probes uh and now we just need to tie up uh the the parsing of that into the data records and then decide the action steps so that the automation that we want to do because that's that's the key thing for me that's why i want an app like this for me is go put some more wood on the fire like that's what i need in my life is yeah it's either getting too hot or too too cold in there and i need to go do something and let me know then you hook it up to your smart fire smoke alarm to know when your fire breaks out uh anything else you guys want to share before we wrap up oh good stuff all right let's let us uh rate our victory drinks then yeah anytime you do an office authentication and get correct responses like that's a victory drink day i mean we api keys are easier for that kind of thing well at least it wasn't oauth today uh that's true i don't think i can handle more o off dragon's milk it was it was real good and we got a uh and we had victory so we'll we'll go four or five dragon's milk is a great four five and you sir chuck how was your nice summer uh rattler i'm digging this this is going down really nice for a hot summer day it is about 40 degrees c here so you'll know it's warm um i'm gonna give this a four and a half also i could i could probably put another one of these away without thinking about it which is a little dangerous for me nice and it was uh it was 92 before that big storm came through uh here so it's pretty taste uh pretty hot um so my karak uh red ale today hmm with the victory it's a four it's good but it is an amazing uh so thank you everyone for joining uh some great fun engagement in the chat today oh six oh six well that's a temperature i thought he was rating a beer yeah andrew other other andrew says six that's chilly but it's still weird it's a little chilly there in upside down land um so thank you for joining us everyone um please uh you know uh share uh your comments in the youtube or come reach out to us on the developer site or in the sn devs channel we always love to hear from you if you've got ideas on how we can improve the app reach out share and join us for the next time so we don't know exactly when the next time we'll do something for this application but we'll work it in i foresee some usefulness that we could use in uh upcoming release of servicenow that's around the corner that we might uh might take advantage of so what now four seven days away six days away from paris ea early access kids i don't know when that is 23rd until it happens it's it's dated for the 23rd and we're recording this on the 17th so people watch kids hopefully next thursday we'll be able to start upgrading our pdis to paris and uh so thank you thank you everyone for joining us and we will look forward to seeing you next time here on live code happy hour and have a great weekend or a day whenever you happen to be watching this in the future bye-bye thanks bye you
https://www.youtube.com/watch?v=UBNHVu51MtM