Converting an Integration to Flow Designer - Live Coding Happy Hour for 2017-12-15

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
1 hello and welcome to live coding happy hour for December 15th the last one of the year and with me are my compatriots Josh Nereus Chuck Tomasi and special guest Andrew Barnes so we are gonna have an exciting show in keeping with the Kingston early access all flow designer all the time we're gonna have some more flow designer all the time so andrew is on as a special guest because he hadn't mentioned that what he wanted to do was to take an existing integration that he's got and convert it to use flow designer so that's what we are going to pursue today so with that let's get to the the longer introductions and let's start with Andrew because he's the guest ah it's exciting to be at the last one for the ear is exciting for next year to be more I'm Andrew Barnes I am a service now architect at Novant Health and I love doing this stuff alright and check hey I'm Chuck Kumasi from ServiceNow I'm the service no guy with the Untied red bowtie that doesn't rhyme it doesn't rhyme Java developer advocate here at ServiceNow in the developer program developer dot ServiceNow comm and it's fun to be sitting and watching for the second week in a row very nice and I'm Dave Slusher also developer advocate at ServiceNow so let us get to it let us go in the same order let us run through our librarians and then we will get down to it was there something that we wanted to bring up before it seemed like there was some business and I can't remember what it is hopefully all it'll come to me there was something we wanted to feature or something we wanted to talk about before we got rolling I cannot remember it's been that kind of week so I'm gonna start make sure today so I actually have criminally bad elf with lump of coal ok you have an interesting Christmas going on when you say mixture are you pouring them in the same glass you're just rotating your load-balanced they are in the same class so it's a dark style with a amber oh so kawaii fancy - yeah yeah nice okay cool do they have different do they have different gravities so that one floats on the other or they kind of just mix thanks they appear to be just mixed okay interesting all right Chuck I have a dish shoots fresh-squeezed IPA I think I've had this one in the past but I definitely know I've had it off show but I don't know if I've had it on show very nice and I've got something brand new Chicago beer around the bend pretty lights it's a Belgian Tripel ale with cranberry and almond and I'm really really scared and I've got the Sam Adams white Christmas so I guess we do kind of have mostly mostly festive brews here not the deepest cut like if beer drinking was REO Speedwagon it wouldn't be whiskey night but also it's not keep on loving you it's more like maybe I keep pushing or riding the storm out somewhere in there Wow all right who's your own subjective rating I don't know what the heck he's doing you go ahead and share your screen and let's get rolling on this so excited I'm excited about this one because this is something that I was thinking of doing over Christmas of taking an existing integration and moving it into a flow designer and integration hub so I'm paying attention yeah and in fact somewhere where I can't remember if it was on one of our YouTube videos or in the community earlier today somebody was asking I think it was on one of our tech now maybe somebody was asking about flow designer as a like a migration path away from workflow and I said you know the answer is kind of a strong maybe it really kind of depends on your use case really but that would be all in the future these are all kind of interesting avenues to pursue right is is you kind of the best practices for like how do you decompose a workflow into a flow designer if you want to do that how do you take any existing thing and then start working in fluid flow designer with it all right what we're going to talk about today is I've got an existing integration that I pulled over into a personal developer instance because I don't have a Kingston instance to actually do this on so I've got that integration loaded I'm going to walk through it real quickly so that we see what the sort of old method is and then what we're going to do is try and replace that with flow designer so let's get rolling here because I get you to increase the font size a bit more absolutely yeah doing some kind of weird artifacting thing I think because we the resolution or something there you've got a crazy enormous screen I think you can tell from the tiny little icons I do have a crazy enormous screen but is that better now do I need one more one more maybe a little bit better yeah okay until until the forms become uncomfortable as my usual threshold so we're talking about this integration today and this is with AirWatch which is a management tool for Mac OS type devices and mobile devices so we use this to track all of our iPhones iPads and Mac OS devices which aren't very many at our organization we're mostly a window shop so this is a relatively small integration for us and but I think it's good for this this purpose so I'm going to walk through the steps which the very first step in this integration is a outbound risk message so I've got that loaded here you know we've got our typical things we've got an endpoint we've got our HTTP request headers we've got authentication we've got a that our method is a get method for this one which further specifies variables in its endpoint and you know we've got the regular testing things going on here some validated this already works right there's no issue with the integration we're just getting that over to right so I've got this integration loaded it's working it's running I'm just gonna want to walk through the pieces of it so that we know what we're replacing from two to two so this is this is working right now we have a scheduled job that runs on a daily basis which invokes that rest message so let's pull that up and get the job definition here which is a little bit different in Kingston to pull those up so pretty straightforward scheduled job here that you know this starts the rest message gets the response parses it and then does the integration pieces which is creates a import set record for it and loads so that's what we're doing here is we're creating a new import set on this you AirWatch table we you know set it to loading we get our parse devices from our input our response then we're creating the individual rows in that AirWatch table and we're setting a bunch of fields from our response into the rows and then we down here we process the import set which kicks off our transforms and then this little sucker down here actually goes and grabs more so we throttle this particular integration to only get 500 responses at a time I believe so we say if we haven't reached the end go get some more so that's the scheduled job and we can go take a look at one of these imports so if we go over here to learn and board since we've got one that we loaded just earlier I'm we only I'm only grabbing ten so that it's nice and responsive and we're updating records so we're getting these mobile devices over here and loading their data in very cool so that's our our starting point is on a daily basis we've got a scheduled job that calls this rest message that calls AirWatch gets a response parses that response puts it in an imports it does a transform and then you're off to the races so how much ice are we looking to transfer I mean the flow itself we could bring that scheduled job into flow designer are you looking to do the rest integration as well as some sort of integration huggbees I don't know we're gonna go as far as we can it's my plan so I'm actually not sure what the limitations of flow designer are and where it makes sense to stop doing things in there and pick up in the traditional methods so I'm just picking up on the fly here that let's get in the flow design I really like today through your use case a little bit so the things that you're good so you want the schedule part to go into flow designer or which parts do you want to flow designer eyes so the certainly the initiating the message the outbound message I saw for sure that that seems to make sense to do in here the actual scheduling of it seems to fit nicely in the flow designer but it's not necessary to go in there to trigger it through flow designer but I don't see a great deal of reason why not to probably where it'll fall off just because I have no idea what the limitations on pluto's R&R is is is you know actually triggering a transform mm-hmm I don't know where we're at on that but I feel like we might get that are just based off of what I've seen that you guys have done you can initiate you know so if we get our response in parsing and that's as far as we get that's fine but if we can get that into an import set then we can definitely trigger the transform from the flow designer because we can do that based on the state so I'm not sure where the edge is my my architectural hat right now says we meet and Josh and Dave can chime in on this as well I'm thinking we should start with a spoke to deal with AirWatch integration first yeah I think that makes perfect sense yeah that's where I would start as well what's interesting what I really like about this is the fact that I mean this whole scenario is a very common integration pattern you see in ServiceNow or you've got to go and reach out to a system and pulling some data and do some processing so looking at how that maps to integration hub you know this is a very interesting exercise to me I'm looking forward to seeing this all right so the terminology of flow designer what's the winter spokes spoke is so to do that even backing up from for designer I think you want to just go create an air watch scoped application first okay watch scoped application got what haven't done anything in it but okay cool so what yeah so then what you want to do is go back to your flow designer then so you don't actually need to you just really just need the scope to exist so if you had an existing scope that you wanted to put this in so at that point when you create your new action yeah anyway let's do it we want that seems reasonable then we want to put it in the air watch import and let's name it like what are we pulling like this first action is gonna be pulling the air watch down right tame it yeah let's name it something about our yeah so air watch retrieval [Music] anything and it seems we can adjust these later through the Edit properties but seemed fairly straightforward there so do you think we should tackle the the building the bow bound rest message parts first so create our our payload yeah I think so like so so in your integration like what's the minimal um thing that you write you says you got the feel for like when you present the action like you want to give as little you want the user to have to require as little config information as possible so have you kind of a notion of like abstracting at the end of the smallest set that would uniquely identify this call to this action absolutely and the smallest scope there is going to be how many devices we want to get at a time I think so we're basically for this integration we aren't since it's so small we don't scope on we just pull down everything it has every day okay that's it's only about a thousand devices so we just grabbed them all every day so all we do is limit the polling to the at the end point to 500 devices per call so we'd want to make that configurable so for our example purposes where I was using 10 so that would be one of the input I would take is the device page size I'm clicking in just one who's gonna be in there as well right well in theory the endpoint would be part of the actual rest operator so yeah here you would yeah I'm not going to ask the user for the endpoint here I don't think it kind of depends the it depends how easily reusable you need this to be right so would ever be a situation where you would have multiple flows with different endpoints not for this one no okay they would all be that so now this one is actually specifically pulling iPhones so we might want to take like a device type device type which could then choose our endpoint for us as a parameter okay yeah that's the that is like that's the things to think about and so like nothing we're doing here you know we can always go back and change later on but the like the upfront thinking is kind of like you want to abstract out anything because what you're ultimately what you're trying to do is make it as like drag and drop and one-click you know as few clicks and a few little typing operation for anybody to use this and so if you're if no matter what they do they're either get they're basically gonna have like the same base endpoint and then the rest are like query parameters or things like that like abstract out anything that you think you might get some value from the reuse of so one thing that yeah that I did in the integration was when you were asking for the page size you didn't have to keep track of which page you've already done and I don't know if that belongs here the input or is that part further on so yeah that gets interesting because you could if the action takes a page size in the device type and it's gonna go and it's gonna retrieve records you could say that the output of the action tells you what the next pages or tells you what the current page is or however you want to do that so you could then go to the next page one thing I will say is I mean generally so like taking a step back and philosophically like the whole thing behind the whole thing behind flow designer is make the actions such that the person that's actually using the actions doesn't know anything about the underlying details so you could also go as far as to say that you you basically put all this in a script and I'm not saying you should but that's that's an option as well so just kind of you know two extremes you can go to as to how much you expose how much you don't so I sort of like the page size and device type is as abstractions and I think anything else would probably the user wouldn't need to specify so if we can do it inside of the without having user and but I think that would be that makes sense that what I would go for here and then if you know worst case scenario you find out later you need it you can just right okay so now we just just say on the variables these are the variables you're gonna be presenting on the form when you drag an action out so we typically here is where you'd make them human readable space separated that kind of thing we can sure we can do that so we're going to use connection alias we need to create one which is there air goes let's just be a little slow in a little tiny and a little time that was really small must be that super high res monitor would have normally fit with the [Laughter] so this is going to be our devices make sure actually this should be more like and what creates credentials lovely little boxes no credentials and we're gonna want to do to teach a basic off oh that's not that that's not the name yeah let's grab that password which I handy-dandy side yeah let's go heylia's that's gonna get annoying I think that dpi scaling is something that Windows is not fully solved yet well if you actually tell windows to do it in so as opposed to the browser it's actually a little happier but I didn't think of that ahead of time so what do I need to connection and credentials yes that seems reasonable yeah all right connection oh it's gonna be yeah here so that connection are all that I threw in there's our our base start point and then we'll be adding things on top of that we are doing hit get yes our path we want this nope wait don't do that this and this is where we need to yeah I'm gonna start grabbing some of the things here so the next one is going to be we want to send over to do to do through our page size is a chess look at this guy didn't we weren't you putting the device wasn't that when you parameters do you want to parameterize that all absolutely thanks in in more comments from the peanut gallery you could actually put these into query parameters as well so you don't have to do string building up there if you just have search and then you could go okay any of that and way just to keep value occurs here excellent nice format so we're gonna want the page size to be shockingly page size you can minimize your step panel on the left if you want that will give you some more space oh that is hilarious that's great so reminder for next time I need to present at this level use Windows scaling as opposed to uh we we probably do need to send a page somewhere now that I'm looking at the end point I need to build here and device type so let's go we need you we'll do just page one for now there so let's let's actually get philosophical while you're typing that so is the page so now the question really would be when you give it that number to the action is that saying that's the total so you're given to the page size maybe what you don't want to do is give it the page size maybe you want to give it the total number you want back and then make the paging and the page transparent to it it's a possibility I don't know I actually don't know anything about whether that's a good idea or bad because I don't know anything about this integration but you could conceivably do all the paging kind of stuff under the hood yeah it's really a I'm thinking that like the page itself might be a little more of an implementation detail that you want to give the user you know so one somehow or another let's keep that in the back room we don't have to solve this right now but it's the thing to think about that maybe yeah yeah may not be what you want you so what I wanna think about that would I want to do as far as this goes at least my thinking on it was present I did you know another user of this with the page size and then it figures out you know how to grab them all so what I might want to do abstraction wise is if I don't want all the results but I only want up to a certain number then it handles the and give it a page size it figures out how to go and grab all those pages mm-hmm but that makes sense but this is this is close enough for government work at the moment and then we need a couple of headers for specifying our can you do to do do we want to specify what do I have this handy I thought I had those right here no I don't see math I see are these some of the tabs I don't in just one moment and I'll grab my headers over here to the side no can't do that doesn't like me oh yes I can actually just go grab these from the other tab ha ha ha first message do have them in my instance we need content type except and Zoe case-sensitive okay intent is i've been messed up with header so many times I just get too literal sometimes there's nothing wrong with that make us happy just capital and we're gonna want JSON for birthdays and somehow we yeah awesome there's there's another one in there yeah it seems to have munch the start fragment and fragment and the other one in the aw tenant code yeah extra copy paste yeah I was really wondering what that header was all about start fragment content say what okay apparently it's really just doesn't wanna copy paste well least you're not getting the the whole hyperlink remembers best friend is letting you down yeah I not the greatest feller but at least all of my code is spelled improperly the same everywhere because I copied pasted it does not like your question mark oh yeah building itself take try to without the question mark it's probably trying to build it itself look at that bingo alright so we have what is reasonably an okay rest up there so now how do you try it to see if it does anything there's a there's a try somewhere right or do we need to build a we should be driving outputs from that it's like once you send that what do you like you do well you can but we can't test it in its current state as well and so I mean basically the easiest way to do that is just to create a flow and throw this on the flow and then you can do it let's just start start a flow and throw it in there and then you can yeah go and we don't need a trigger because we're going to invoke it directly action and we need to turn on always our draft draft actions someone's been watching I I watched I watched some of the shows today on 2x speed so Josh it's really fast at learning this stuff at 2x speed [Laughter] it is funny I listen to a lot of podcast and sometimes I go and I listen to things at normal speed I'm like why is everybody talking so slow everyone sounds drunk when you listen to a thing at normal speed when you're used to fast it is so true so we're going to give it a couple of parameters and Ted they're going to give the road you don't remember that part so the test button is grayed out I'm guessing it's because there's no trigger is what I'm thinking that's interesting because the chest skips the trigger yeah that's funny so we can go ahead and at least reasonably simulate it which is I think we were running this daily at two o'clock yeah yeah so now you've got button cool that's funny you need trigger but you can't you don't actually need the trigger well no you actually do need the trigger because whether it's timed or if it's a record-based trigger it's going to it needs to know whether it's a record based or time-based because if it's record based is gonna present you with the picker that's a good point that does make sense saved flow has been executed we've got an error look at that action refused oh we didn't specify Oh a sir that's where the mystery cuz I do that's where ever saw mystery is here because we need to see how we send this through a net Sara backs away slowly so I'm guessing this is going to be in that connection record I might actually go back to the main platform and explore that connection for credentials is the credential and here's the connection okay let's take a look see what's for Josh seems like an important but but maybe that hey maybe that presents the mid server choice in the flow designer you are so optimistic in my development slice of things that I've done I've never once used a mid server so this is I haven't just managed to always not not be down that path so that's close but it was a long time ago yeah I've done more mid server of stuff than I would care to think about but it's been a while it's been a happy Wow what I suspect might be the case here is there might be some kind of like mid server capabilities thing where we're basically we're saying that these are the mid servers that are eligible to pick up certain kinds of tasks which is kind of more of an orchestration thing right where you where orchestration can go and basically will run on different mid servers based on what the mid server is configured to be able to do discovered anything yeah that's why that's why I suspect that I don't know for sure that's what's going on here let's go check your mid server configurations we could just give it a yeah we could do that too I mean just just to see if that was magical cuz do it so optimist even point you to say hey admit is not yet supported on integration hub please don't do this Oh bummer however Lunda this is still possible right you can use a script step yeah so you so we got to switch it from this we can't just do the rest step builder yeah use a script to call the rest message yeah so we can call our existing rest message because again this is an existing integration we're not building for a new one so we already have that risk message and we could just call it which is what we're doing already you've got a script letting the scheduled job we could just steal a lot of that so let's go and change that process then cuz well let's just make a new action now we're gonna pop a new rule well it depends on what you want to do because you could add a script step in here if you know basically if you can't use the rest up anyway you can throw a script step in here use your inputs save a little time if you want where's the button to make a new step looks like I'm wondering though saying read-only action did you did you pop out of the scope at some point or something unusual like that same read only up there I'm not sure what yeah I think this is this yeah okay now we're better suppress us the either of the plus button above or below you will yeah we didn't that we didn't have any buttons because it was there is a look at that script step and we're going to and I think this is really interesting because what this is showing is that well maybe the mid server is not you know sort of baked into that easy form there's still a path there's still a way to do this and so we're discovering stuff for the people that yeah it's funny that there's a button we're gonna scan all the instances and find out how many people check that button and that'll tell a product development hard to work on it but a plus on giving us an error message that actually let us know away as opposed to error if 367 not permitted function not found all right so we do have our chopped definition down here which the part here is reasonably good stuff so we want to want to grab that pocket lease for sure come on in here is where we gonna have to swap out your parameters alright let's see if there was anything else in there useful that we needed unless we are gonna need to do that I don't know if we'll do it exactly the same way in the script but we'll pull it over for now then I think that was it for as the rest of it was post-processing stuff so the actual just call them in server and do something is what we grabbed yeah let's go from there I've got my optimism hat on today I don't know why to be Josh I was just gonna say one thing I I just noticed and now is the perfect time to migrate to the new thing is json.parse instead of JSON parser oh yes you can tell the era in which the integration was written by based on you know based on if it's using JSON parser or json dot parse or the era in which the developer was trained we're doing what so what you can do is actually just not yet you can just get rid of y9 and then in your line setting there it's just capital json dot parse JSON yep there you go and this was something that came in with ACMA script 5 wednesday that happened i'll think he can also need to swap the page number parameter under step or online for numbers I call it or was it inputs that page underscore number I can't remember as well we don't get the page number no oh that's true we were gonna we're gonna test this with a one I think yes we hope that someone nope my heart coordinate yeah that was in the arrest message one so that's one now yay actually I think thank you lord zero for this purpose because H number because we want the first one which happens to be zero for this integration yeah yeah might get us something now it's their way to just tell this not to be actually we just get rid it let's just get rid of it we don't need them anymore yeah we can rebuild it better stronger better faster and run it between the REO Speedwagon and the Six Million Dollar Man we're generally showing our age in this though I mean while I'm like I have no idea what you guys are talking about Josh makes me feel bad about that sometimes I'm only have to have a story I can tell you about knowledge a 16-man in this crowd today I don't know that you are a cow all right let's see error constructing we probably didn't send it everything of wanted because we didn't handle the speed are not sending the page let's go take a look at our isthmus and real quick well I mean it should have been everything because that's what this is doing what else is you looking for it's just I'm not sure if I I love this or or not yet the you have to click the open record I feel like I love it but I'm not sure yet still still getting used to it it's definitely an adjustment yeah at least it's consistent though so the only thing I have to send it is page number so that should have been it that's the only thing I'm required to send it out hard-coded the rest of these in this see I forget parameter execute is the last message v2 verb case-sensitive it is what else is lowercase get gonna be a problem actually oh that was the name name okay you might have to do global diet it one one way to try this out is if you go over to if you go back to the rest message and do the previous script usage I'm just wondering if there's anything different showing up there that is a button I love that button so I found AirWatch get looks III would throw before iPhone just put global dot and see what happens and then also make sure that this is accessible from all scopes which I guess would probably end up being on the message yeah this guy this look here we go all right let's switch our scope here open this guy up haven't haven't needed to do that all the time as we do in our production instances all right should have made it relatively more happy let's just give it a whirl text try get the thing know hey that's better no it's not the same message I think it is but I think try the global that thing now and see yeah one thing at a time one thing here because in the string so it'll be inside the current Astro yeah right there and it's weird it feels really weird cuz there are spaces in it and all that but I think that might that do it that just feels it does super wrong I'm watching I'm kind of hoping this doesn't fix it because oh my god yeah it's a weird one you are right that that feels dirty and wrong really does which I mean ultimately you can choose what to name your arrest messages but it still feels wrong is that because so what why is it is that because it is implicitly named scope and dot whatever and because this is built-in this is built a global scope that the name of it is implicitly global dot whatever you call it yeah if in and if we had done this if we were in global scope already or if we had made this message inside the scoped application we don't have to worry about the prefix but because we're crossing scopes we have to add the prefix yep right so if we're doing it include so basically the actual name of that although you don't see it from the UI the actual name of it is global dot I phone - air watch the iPhone space - space air watch it's just that it's hidden from you the way that you view it in the platform yes if you look down in the database table its global dot that and so yeah that's who okay no I don't know if it's stored that way in the database I think it's just a runtime artifact of crossing scopes yeah but the the putting that thing inside the string value like this the value of the literal string just feels this word yeah I mean one thing I would say is that I would argue that probably in nine times out of ten you're gonna want to put the rest message in the scope you're working in so it's less common I think you would cross scopes to call a rest message but yes I guess the other thing is that it's global like if this was X underscore one-two-three-four scope it wouldn't seem so weird to me I think yeah true it would feel more natural then and yeah I would think you'd want to put the rest message inside the same scope as the thing invoking it for most things I mean if you were like if this is green field then you were starting from the beginning you would be creating a spoke which would be a scoped application and he would create the rest message and the action and everything they were all be bound together yeah but what you're presenting here is an extremely real-world case that a lot of people are gonna have yeah that that's why I wanted to do this was see how how I can leverage this to adjust things so that we can make some of the integration work gets done accessible to their you know more middle tier parts of our teens as opposed to the upper tier integration levels so I know I saw lots of logs available when when I was watching the videos earlier is there I don't see maybe just because I didn't tell it to do it can I see the response scroll down a bit what do you have that's on your script you didn't actually do anything with the response right no I didn't do anything with it that's why I was saying yeah we could we could throw some GS infos in here right yeah or you could chaser or you can just do outputs dot response equals yeah yeah there you go yeah and the key here is and the reason for all of this is that we're not at this point using the rest message step the rest message step is we're all that rich this came from and so since we're basically just calling out to a script include we don't necessarily know what that script include is doing it's just doing stuff or you know that external script is doing stuff and so it doesn't have the same level of richness unless we actually set it up what's the syntax here I think it's yeah whatever you name it is what your variables gonna be called alright and then down at the bottom you have to actually add the output as well it's an object though you parsed it right it's parsed so it's a string at this point wasn't response body a string Oh Jason parse it's now an object yeah you know what you want what might want to do is just just coming out that partial for a second and just pass the response body yeah and leave it as a string for him for the moment like I said I'm a I'm a copy-paste just and just call it response yeah I mean call it anything but parse now [Laughter] anything but first used to work with a guy if he's watching this he'll he'll get a kick out of this big called everything Bob he was like yeah it's just Bob and I always find the variable Bob throughout his code it was pretty funny so now we go to our step and then we get our output which is exactly what we wanted to do so yeah we have output so we got up nice very nice so we have ten you know actual iPhone devices and all of the information that we wanted about them available to us to do things with now so step one color s message successful okay like we like that so now that we have our message we need to then see if we can do something with that like put it in to either so and perhaps this is where we think about what we want to do and what's available to us do we do we go the path of putting it into an imp or set and doing transforms or do we or do we not need that step anymore and do that work here I don't know so the ideas on that from my first question would be how complex are your transforms do they do a lot of super easy they're super easy I would just take a sure step away yeah I would just make straight-up calls because I mean for me they're usually my decision making process with transform Maps is are the related fields and related records and do we have to deal with sort of like reconciling reference values and do we create or insert choices stuff like that yeah and if it's not you know if you don't have to deal with that you might be fine just processing it directly and the downsides that brought that up because I was like this feels like it's an opportunity for us not just replicate what we were doing before but to see if there's you know some some things that we can take advantage of here that that we might not need to replicate yeah you know transform instead of replicate yeah and then sort of kind of you know basically bundles up that functionality of what the transform is doing and kind of replaces it all of these strings are going straight into string fields so there that we're not doing anything to these we're just taking these and dumping them in other other fields so is it a coalescing on a thing so like what's the it's absolutely coalescing on our serial a serial number okay and which one is just a matter of saying look it up and do the thing and yeah I think I think take it out you know the downside the only downside is if you wanted to be able to look at the thing afterwards and see the entire result set of you know what we're all the records that came in and was the status and all of that that's where transform ask to shine and so there is some I guess traceability and debug ability that goes away by getting rid of them but if there's not a lot of business logic there I don't think you're losing a lot yeah and that traceability is also more at the so one thing that I liked so I do like to use the import sense and not to get too off track here but the if we can skip them that's good but I probably also build into any of these integrations that I do that skip that to have like an inactive step that uses that instead for a way to debug it on the fly because there's not really that they only go back seven days on most instances anyway there's imports it's because of the table cleaner for that so if there's not lots of historical information there's just you know near historical information so usually by the time there's an error you've missed that window in that makes sense at least in my world so so yeah let's try and skip it so we've got an output as a string right now do we want to send it as an object to the next step yes I think so I guess it I haven't played much with native objects and passing them around so in our output types is there a generic like a JavaScript object or some kind of object we had the basic field types so it might be easier safer just ever yeah yeah parse it where you need just handle and parse it where you need it yeah there's that name value pairs thing that might be close but then if you had some kind of nested thing you might that might break down yeah and I think that's the platform name value pair in it yeah yeah so yeah it's probably not gonna work quite yeah that makes sense so we've got our output variable so we need an ER stat then or do we go and create another this this is an edge where we might want to create another action or not um that's a design decision I think at this point right yeah so let's um what we might want to do cuz we're at 5:26 so right consider we might consider just stopping here on the question so why don't we talk through the question we I don't know that we want to necessarily implement it at this point but let's talk through the the two possibilities which is one is which is the very next thing that you do I mean so we actually get three possibilities right which is you add you don't return that response body which we kind of stuck in there as a you know just to see it right so maybe you parse it and handle it in this script possibility to is you pass it as an output and another script action another script step inside this action handles it step three is the action returns the payload and another action handles it right yeah I'm gonna say I'm gonna just say that I probably think step three is the worst of choice because in general what you don't necessarily want what the actions is to have to have the input to an action be a payload of a thing that's a little too that's to implementation detail II for yeah we want actions to be about that make sense so then it's just really do you want to and then it's down into composability is there any value in having another script step or should you just do what you're gonna do right there at line 11 see I'm I'm actually really torn on this because part of me wants to say yeah we shouldn't we shouldn't pass JSON bodies around and things like that to other actions because whatever but at the same time I guess part of this depends on the audience of who is expected to actually consume these actions so you know a lot of actions we think away we want to be able to give this to a process owner maybe they're not extremely technical or maybe they don't understand all the details of integration in this case I feel like that's not maybe the case the consumer is the developer and right so like my question would be it could there be multiple ways in which you would process the output so maybe you retrieve stuff and you do different things with it and if that's the case would you then maybe want to have more granular actions so I don't know I'm really torn on what the way it's it's really you know I think of it as how i hook up devices in my smart home I've got an outlet it's got inputs it's got outputs it pretty much does the same thing every time no matter where I look it I I can put a lamp on one end and I'm gonna plug it into the kitchen outlet or gonna put a vacuum cleaner in one end and put it in the in the bedroom so it's that's the way I kind of think of the actions is if you separated them into separate actions could you take that let's say we have one that invokes the message and one that processes the message you're gonna have to make sure that processor understands that it may get different inputs from different actions not just from this action so it's how flexible do we want to make that next action versus if it's are tightly coupled with the response to process it in this action and that's exactly what I was thinking here was was if we are talking about doing it for import sense and actually still utilizing import since then I would definitely want to have an action they could take a payload and put it in an import set that is that case yeah they're repeatable take a JSON and dump it into an import set you may have one action that says processes through import set and it says okay with the input for that action is what import set and where's the payload coming from and the other one that says let's do a direct table insert and it says what's the table and what's the payload so yeah I could see that now there might make sense in that case so that could seem to to sort of drive that decision step there is is if you want to skip as Josh was saying is if you're going to make it specific put it as close to the data as but if you want to make a generic then you can move up these these layers and make it available good design discussions yeah Mike my gut feeling is is that if you're never doing other different logic with this payload mm-hmm then you just I would say you just handle the payload right there in line 11 because there's not a whole lot of value in passing step-to-step mm-hmm unless you just want to have like really small steps but you know that I would probably handle what I'm doing there and try to make the action as complete you know as complete a basically as atomic and operation as you can think right I can't even see breaking it apart like you would a script include you know there's a difference between having one function with 600 lines in it versus having say 10 functions with 60 lines and a horse 60 functions with 10 lines in them it becomes a maintenance thing and and almost uh a discrete dis what does this step do granted the steps are going to execute in that order and not be called recursively what not with yeah I mean well you could have a you can have solely a fetch step here and solely a process step and then solely an insert step or whatever you know like that yeah well and the one thing that that that would do is if you're fetching and then processing in two steps is if later on down the road you want to convert your fetch step to use the rest step at what point you know right it servers right that's a good point capable that would be a thing that would make it definitely a thing is if and if we had this retrieved step and we could you know do the processing in the next step this could be replaced when we can use the rest step builder when they can handle Mint service yeah yeah I think that's definitely there and then the other thing I'm glad you mentioned script includes Chuck because this is one of the things that some of those out of box spokes do which is slack for example bundles up that common functionality in the script include so there is a point at which you get into sort of more traditional we're going to create a script included that does the common stuff and then just call that in the action so then you could have multiple actions each of those actions being atomic but still reusing the same code base so that's an option too well that gives like three levels to your development after you've got somebody who's in the script include code somebody who is managing it into the steps and and actions and then somebody who's actually dragging and dropping it around on a flow that's that's pretty phenomenal stuff from a from an operational standpoint well yeah I think I think they're two takeaways for me on this or that a I don't think we have a clear there are clearly some things to think about between now and the next time we pick this up and the second thing is that the platform gives you the level of the level of robustness you need for your use case so if you need one you can do what if you need the other you can do the other all right so I think stop sharing today well alright okay that was pretty fun I like that so let us go around the horn Boyka dorky kinda eastcoast central alright so I hear that same year what's your rating on your you're mixed drinks you have okay you also have a very poor separation of rating because you're not reading either beer you're rating the mixture of the beers I actually tasted them separately and then put them together and the amber so the criminally bad elf is gonna be gosh it was pretty good I got for two else so it is a look at hail amber I think it's amber it's like an amber but it okay so it's it's very light in color the lump of coal dark holiday style however was really good but it actually if I tasted it on its own it would probably been you know near a four but but combining it with this made the merger like four three Wow they're both improved by joining your you're clearly not an untapped user because of the three to seven all right I'm gonna give the Deschutes fresh-squeezed IPA the 3.75 it's it doesn't it might be time of year like I said when I had the SIA hard cider the other day it it doesn't feel like IPA season to me so a little lower than the last time I drank it all right Josh the around the bend pretty lights Belgian Tripel with cranberry and almond it starts out tasting like a Belgian Tripel and all of a sudden you get this burst of cranberry and almond and it's very tart and it's very weird contextually it's a 3.5 on a normal day to be a probably a two and a half I don't like it very much but it makes me think Christmas and so they actually the rating goes up fruit taking the kids and the white Christmas again has helped a little by the context I was thinking for out like during while andrew was coding I actually entered this in untapped and is one of those ones where I went back at my previous writing was a four oh now for you to other untapped users what's the for a beer you don't remember ever rating before what's the wildest swing you've ever had you know when you go and you say all this at three and you realize you've rated a 4.5 or something like what's the biggest swing you can remember two full points to Wow I'd say I never went more than one maybe one and a quarter I'm gonna say what like 100 I don't even ever been more than one Opeth it sometimes even 100 feels like a lot to is huge right take you like from a four and a quarter which is pretty sweet to three and a quarter which is may well below average so I've never had even a full point swing cuz cuz I'm a robot same input same output there you go Andrew Barnes the drinking touring machine alright so with that my friends were gonna we're gonna wrap it up for the year unless are you guys having one next I guess we're not you say a company holiday next week I think so yeah I'm off alright so we'll see everybody in the New Year and Happy Holidays to those on the US who celebrated and happy whatever you've got going on outside outside of the Western world and see y'all in a couple weeks yeah alright
Info
Channel: ServiceNow Dev Program
Views: 1,041
Rating: 5 out of 5
Keywords: servicenow, lchh, live coding happy hour, flow designer, integrationhub, app development, kingston
Id: w8lM2dYQytI
Channel Id: undefined
Length: 67min 25sec (4045 seconds)
Published: Fri Dec 15 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.