logo

NJP

Hacktoberfestravaganza! - Special Edition Long Live Coding Happy Hour for 2020-10-14

Import · Oct 14, 2020 · video

[Music] thank you [Music] foreign [Music] hello and welcome to Live code happy hour on October 14 2020. um it is a special time today because we're going to do a special long session so let's go ahead and dive right into introductions Brad say hello hey everybody my name is Brad Tilton I'm a developer Advocate with a developer program here at servicenow I've been doing development on service now for about 12 years been an employee for the last four and I am ready to get into some components and spokes for the next four hours all right thanks and Chuck hey my name is Chuck tomasi senior developer Advocate at servicenow like Brad I started about 2008 in fact I think it was somewhere in October we signed our contract and then immediately went for my sysadmin right after that seems like many many moons ago yet so many things are changed so many things are unchanged I've been a employee at service now for about 10 years and uh I think I've got the best job in the world right now all right I'm Andrew Barnes uh also developer advocate here at servicenow and I've been on the platform for six years I've been at service now for two years and uh specialize in doing Integrations custom applications and development at scale I'm super delighted to be here with y'all today uh and uh we're gonna have this nice long working session so we blocked out this time to do work together um we traditionally introduced our drinks so let's see what beverages of choice we have today they'll be slightly different than usual yeah I am drinking a locally roasted Black Coffee in my Astro smoke this one Astros mug what do you have Chuck I have two mugs one the classic Carlton Fields that we got from the Tampa Bay Dev meetup group and the other my insulated canteen from can't see it from servicenow and one is filled with um I think that's like a licorice or an anise herbal tea and this one's more of a chamomile herbal tea so I am ready for the next few hours too fist in the t's got it I am uh I've got uh some lovely um morning Baraka uh that uh I got from our Australian Brands and then some some tea when uh when that's done in my my old service now oh yeah I got one of those too don't show anyone The Branding it's on your shirt [Laughter] Creator con uh coming up here this month um so you should have seen some announcements already around uh and if you're a fan of the show you know we've already mentioned it a few times uh we're gonna kick that off uh on the 20th with uh some workshops and breakouts uh that are available on demand um there's some older stuff from knowledge that's going to be in the pool and some newer stuff that we've created uh just just recently uh on Paris content and then on the 27th uh we'll have a special Live code happy hour during the Creator con and lots of other really interesting content for you on that day uh both for current content and future looking content so you'll get a little taste of uh Quebec and Paris during that event and we're looking forward to that uh to cap out this hacktoberfest month um which we're in right now um one of y'all want to tell us a little bit about Oktoberfest before we get started on working sure uh so we are what halfway through hacktoberfestyle a little less than halfway through um so hacktoberfest is a virtual month-long event uh put on by digitalocean and it exists to encourage people to contribute to open source git repositories and for the past few years the dev program has also participated uh in kind of uh adding some uh some Focus to some of the things you can work on and providing some examples and and servicenow specific things that you can contribute to through git and I think here in a little bit we'll take a look at now we've got two main places where you can find repos to work on for both now experienced components and integration Hub Spokes and we'll take a look at some of those and maybe look through some of what people have done so far and then I will I'll probably do something with a component and then I think Chuck and Andrew later on will do some some spokes stuff I definitely got some spoke work in my queue oh yeah my story backlogged this morning and I was like hmm spoke work today a couple other quick announcements we do have a tech now coming up on the 20th that is all about process automation designer it is part one of two part two will be in November on playbook so don't miss that if you want to sign up for that go look for bitly tn80reg Tango November eight zero Romeo Echo golf wow had a really strange picture that was painful don't do that at 6am kids so go over to T bitly tn80 reg and we will have that we'll save you a spot it's going to be there of course it'll be available on demand after the afterwards after that the uh but it's always fun to join live the other one is we just dropped a few hours ago the latest episode of breakpoint the service now development podcast with our special guest upside down Andrew Andrew Albury door was gracious enough to talk to us about things he's built things he's done what he'd like to see in the platform what he loves doing of course you can you get the history of where Flava kit came from and and much more that's not a teaser for a developer I don't know what would be I like that cat with with him there's an Andrew watching our repos for pull requests like 24 hours a day between the two of us in a bridge you can find that over at bitly slash SN Dash break Dash Point so I said awesome you remember well go listen to the podcast it's free too I love free content Brad you wanna uh get us rolling in uh yeah you want to just do some Dev work first repos when when you're ready to do a pull request okay that feels like a nice flow I can do that um yeah let me start sharing my screen here thank you to everybody who's joined on YouTube we got a fairly good crowd that's uh yeah hello there even if you're just playing it in the background while you're taking care of laundry or dinner or the kids or whatever really appreciate started in your morning how however you are uh or you're wrapping up your day dunking your Donuts it's a little early for us we got three three different early time zones covered this morning it's definitely the earliest dark foreign all right so this is the repo oh the Tea's still hot hot hot hot yes it is and hit uncapped mine otherwise it'd be hot for six hours sizing up the screen there we go okay it took me a little bit good man and then let's open up vs code what do we have going on here so I'm gonna get started with a component actually let's take a look at so we did a component on Friday's show uh that was our we did we put the the choice list picker into the artifact creator yeah so I have some other stuff that I was going to work on but this is actually the most uh this is a real-ish use case for us I I caught a little bit of that that was my first show I've missed this year wow wow you got a good track record buddy it it was a it was a good good run I I think we've done a show almost every week for this whole year yeah there is no which is which is the most consistent we've ever been with this show that's because of the quarantine we have nowhere to go we're just going to keep cranking our content that's true there's I've not been on a plan on a Friday afternoon so all right so this is uh what we have going on for this quick ad component Let's uh let's develop it and try to remember what it does now lick it now licensing or now lice I'm not sure what we were developing there well I didn't even want to work 2-0 or 1-0 two dashes should have done something are you in the right folder I think so maybe I'm in my PW CAD let's take ewt yeah wasn't it in the folder in there though yeah but I I think you just you run it though you run it at the root wherever the um now CLI Json is okay this one so let's do an LS because I think it's in the AM Dash quick Dash ad is it not I think you got to go one level deeper we did this on Friday too but uh I don't think I uh quick Dash ad if you do an LS it's CNN cli.json you'll be there if not you got to go into the oh you know what yeah because we pulled this down yep tab there you go it helps to know a little bit of Unix when you're doing this command line stuff kids hey look at that maybe I'll make a quick Unix series but I'm sure there's a ton of them out there I'm connected to the wrong instance well that might not be a bad I'm gonna jot that idea down for later just do one episode quick unix commands you want to know thank you uh why are we I was thinking really hard there we go and you guys cannot see that bar to the left darn it I thought we had that covered I thought we did too all right uh so this rendered except uh I don't believe we are connected to the right instance here oh um because it connected to my PDI I saw it doesn't matter uh it'll matter if we try to add a artifact to my PBI yeah oh yeah that would um yeah so all right yeah so what we did on the uh on the show was we added this drop down so that I can specify a type and I think we ended like a few minutes early it went a little too smoothly um I'm not saying it had anything to do with Andrew [Laughter] all right so I'm gonna uh what you're saying is I push us too far [Laughter] interpret it any way you want so I am uh that's why I think I'm logging into my uh to the dev program Dev for instance Talk Amongst yourselves alrighty yeah so what he's doing right now is um the now CLI uh can connect to different instances um and currently he's connected to his PDI uh and instead he's going to be connecting to one of our instances um so he's got to set up that off and uh in instead of invoking the Privacy Shrubbery he just dragged it off the screen because because Brad's never been as entertained with the Privacy Shrubbery as I have um and once once that's done and we're connected up to the instance we'll be able to uh validate that this component is is operating against the correct instance by creating records um it looks really good um what y'all did on Friday getting the the little drop down um yeah and I like that you you chose the the primary uh on the the button that actually really matters I like that yep yeah it's all in the uh all in the usage docs it it is in those usage stocks on the developer site developer.servicenow.com thing I got you [Laughter] I don't I don't even have my little buttons in front of me so all right now if we run our now CLI develop again let's have it open a new tab again for just for the heck of it just cuz Hey Dev program dab look at that I typed in the whole login command uh without making any typos and it worked the first time nobody saw it so I can't prove it but it happened and where it whereas I would have gone uh you know into the the The Bash history and done like bang now CLI login they have Pro and then stop and then it would have found the last time I did that and done it for me because I'm lazy all right so that's one of those commands Chuck can add to his Unix I don't do Bank too much I do a slash I'm more of a VI guy I will write that down let's see well I use VI too I'm just saying uh you use the bang to to go backwards in history to run a previous command yeah and I'll do what is it like Escape slash and type SSH and it's like here's the last SSH command you did I think they do it so I'm going to be doing some experimenting this afternoon so I created an artifact let's make sure it's still working here that does seem uh reasonable to do all right and my puppy is saying hi if you can hear her hello little puppy I can hear it it's not particularly uh overpowering though hey there we go oktoberfestravaganza and it is a video so there are a couple of things that I want to do with this one of them is I would like a message that tells me hey something happened or something went wrong or something went wrong yeah and maybe gives me the artifact number although I guess something went wrong you wouldn't have a number but yeah yeah I like the artifact number but I especially like it if it's a link oh yes so would you do a link to the workspace record well ultimately this is in workspace so I think I would want to link to the record in the workspace that's what I want too we are agreed all right so we've got our artifact Let's uh let's go to the developer site component playground oh so we showed this on the show Andrew and you were you were not on it wasn't here it is right after he was so excited oh yeah yeah I've been uh we've been working on this uh for a little while now and uh it's I I'm really stoked at how it turned out I think it turned out really good um yes it did yeah so we want we want to look at alerts all right so we have another list in an alert I want to go to the alert right and so this has changed up just a little bit I think the playground got split out uh into its own thing um we also fixed the uh if you had tried to use the install uh message that was up here before uh that did not work um which is fixed we had a few people mention that so this is our alert uh this looks good I can I can do a link so that's great um yay let's come in and look through the API a little bit thank you so so status is something we're going to want to know um this is going to set the color and then text link props so I believe this is where we are going to set our URL yeah we don't have to uh we don't have to you know encode our HTML so that it shows up correctly here I think it's just going to let us put some things in places More Time Savers and then let's look through the usage I like to do this before I use a component just to make sure that the way that I am planning on using it is not the way that they tell you not to use that to do it I have run into a couple of times so far like you should not use this component for this like oh cool all right that's exactly how I was gonna use it all right well maybe this wasn't the right component for me all right so you have this avoid using icons right so this is not really an informational icon hmm um there's only a couple of don'ts on this one yeah so don't use it you know One log into your account two do this three do this um so this is as a you know as a developer this is really helpful uh to have you know these types of usage guidelines on the front end here uh so that you know we don't get six months down the road and you have just a really inconsistent experience with the things that servicenow is including in workspace and then the components that Brad makes that don't follow any of the same usage guidelines um not that that would ever happen that would never happen all right so let's go to the playground the fun part so I guess we kind of need to know how the text links props wanted that link that was in API so it wants a label and an href okay and that should be available here when you choose the drop down from basic um potentially if they're due in advance yes nice [Laughter] and not go to the.com but it's fine so it doesn't have to work it's an example so possibly my favorite part of the playground is that the icon now Auto completes the icon field with supportive uh info oh did I say that too soon I I thought they Auto completed as well yeah I started too now click and then start typing all right so hey there we go weird experience it's just a weird experience I like outline and then I also like start typing then click again info and then content we're gonna say your artifact was successfully created artifact and then we'll have the record name let's create it oh no I was thinking for some reason I was going to insert the link where record was I was wrong yeah how do you tell it where to insert the link uh it just doesn't have the end yeah I don't know there was a you could put it at the beginning too there was an example there maybe a middle um I think there's a property for it it takes link props um so it should be in that code there I thought we had an example so where you put the text link props doesn't look like it's embedded inside of the content at all I thought there was a end um so let's uh grab the code foreign the code for now and I'm just gonna come back over here and paste this in and then we can look at the example uh so and we'll make that look better in a minute where there you are um yeah they've got an example that says case blah blah blah with a link has been updated by John Miller I wonder maybe that's just a crazy screenshot that doesn't really exist or yeah I thought it had a I thought it had a property where you tell it where you want things to go but I may be thinking about the input Fields so version two we uh yeah we don't need to worry about it here um well and to me it makes sense that the the link is at the end because that's the action I want them to take and so it's prominent and it's at the end is here's some words and here's the link just uh here's another bad usage example don't type click here with a link uh what's that thing called it's an alert was it alert I'm just trying to find that I think we're gonna have to do an if but let's yes I would very much like to see that thank you all right so for now I think step number one is let's make the link show up and then step number two will make it hidden until we do it successfully okay all right so let's uh let's first see if anything shows up we're loading all right we do get it to show up mm-hmm so let's look at our action handlers and I believe we just need to return more from our artifact are we I don't even think we're returning anything at the moment uh succeeded yeah so to first we need to add a couple of State Properties that seems reasonable I think let's just did you want like a you know an alert uh yeah in fact I do and then let's suppose if we just call it like show alert oh that semicolon's gonna mess you up uh it certainly is all right um so maybe I should well we can go back and refactor he says and then never does it never does um so Never Say Never uh payload this is the table API foreign I feel like we should test this so the question I have is when you're do you want the content for the alert to be part of the alerts States objects or do you want it to be there so the way you put those properties is they were their own but do you want to pass them as part of the alert object that inside of state so state DOT alert Dot artifact record number yeah I was kind of thinking of uh having an artifact object that all of my I guess these are these are both new artifact um yeah so we could have a we could have an alert object that has the things in it yeah I think I think it's fine either way I just wanted to because no that the time that was part of my uh right now is only as part of the alert yeah that was part of my uh refactoring comment okay um oh those don't look good [Music] um oh I'm not gonna get it till I create something undefined uh where do I have the snapdom rendered you have a console.log in I saw it uh yeah so it's saying result is undefined so let's uh let's just see what my payload is you need a stringify it or not uh I think I should because it appears to be an array let's go there all right so result not oh I don't think I need the uh because this is not uh doing a get her description is testing Again YouTube video yeah so it sent back the record content yeah I I don't it's not an array of Records it's just yeah not this time contract yeah all right so result and then I think I just need what we call that artifact is so that oops plural on there I do uh where's no what do we call this number I thought it was number and okay so now that those are set in your Handler uh you can use them show alert yeah these these should definitely all be part of a object that we then pass all right and then let's go into the view I need to grab them I guess this is where I would have voted for the object yep those past Brad was being lazy and uh it hurt currently it's all happens never mind all right whenever I'm passing more than about three parameters like oh this is starting to feel ugly when they're not even closely related the label we're gonna have to figure out what the URL is but for right now we'll just make it the artifact ID okay oh uh and then we're gonna have to do an if yeah somewhere we have to do do you do the conditional logic in your so we can do this a couple of ways we can come out of here and then set a variable to the error message and then just show that in here or we can do the actual if logic in here with something like um like wrapping this into jsx um the other option is you could pass the status type to this and then instead of saying status equals info status will be what you want it to be because you're showing an alert either way the only variable yeah a good message and a bad message is hey look this one didn't work and then that puts the load on what was it the const.js Constance to determine what you're passing back in here from the Handler but we don't want the alert to show up at all until I have created something so when the page loads it shouldn't be there so I think oh I see yes okay you don't want it for a page load um no so um Brad why don't you go take a look at your to-do app and how you handled the alert in there hmm I have done this before because it was done in a way that I like there and it's okay I may not have done that one uh some some coming together to your to-do app it is hacktoberfest after all uh did it in a way I like so on your uh to-do list right in the list in the view up at the top I think it is uh yeah there you go yeah yeah we can do that that is uh fairly straightforward and where was that set uh so ours is going to be show error uh show no show Alert state DOT show alert yeah and then I think we had what no yep there you go it did not like what are we yeah [Music] um what did you not like what line 11. oh you can't just write it you can't just say let return let us return that looks better hate it when that happens at least it didn't take 30 minutes to find it this time foreign looks promising do I pay attention when there's pull requests I was like oh cool alert oh I'll take that out later and so this morning I was like Hey alert very nice we are mostly there mostly why do we have a warning symbol though except our uh our number didn't show up yeah probably because it's not a properly formatted HTML that could be maybe it's smart enough to scrub them uh yeah so I guess let's I would think you could put in a relative URL yeah let's uh I'll just type it in for that perfect ID artifact number foreign that's where I was gonna go all right well let's see if we got uh if we even got those back there's your format when you're ready for it for the component I format yeah for the URL for opening oh got it see if we even got those back we did not oh you're not setting them are you in your Handler oh you are we are empty how did that happen or there's another uh it's result.something Let's uh short description short under description was your title and a title you got you should get back a title well uh we passed a title to the API and there was no one setting it to Blink when we dumped out all of result or all of action.payload it said result Dot short description was in there all right let's let's try a couple of things then yeah it tells me Windows completed for me no weird something tells me we're like a DOT off or something yeah off by one the programmer way foreign if I write a book that's all calling oh sure a short description is undefined result Dot short under description test but it has yeah what are we missing it looks straightforward but why don't you pull that into that what although there's a 404 right above that too which kind of bothers me uh it's a fight oh Justified once you put that uh in a beautifier or just you can no you can do it you can do the beautifier in this stringify can you yes go back to your code I do this every time in fact I was going to tell you it's driving my OCD nuts say right after result inside that parenthesis right after a result you comma null comma four done oh four is your indentation size null is a function that nobody ever uses oh my God color me excited yeah I was excited when I found that out too when you're going into deep complex arrays and objects and whatnot this is really helpful uh so result does result have another result result is yes it does that's what we're seeing because you printed this results and it wouldn't say I have a result oh you know what because you named your variable results [Laughter] Halo it might have been more appropriate wow Halo dot result nice he's so confident he's going to delete his debugging statements look at that confidence it's exuding from you [Laughter] this one you know you do that it's a curse I know voice [Music] [Laughter] all right and then Andrew sent me something perfect we've been spending like the last 45 minutes to put a message on the screen [Laughter] what do you do for fun this morning uh that's where I want I don't want this here forever but I think should we add the entire do we need to program Dev it does we need the entire thing because it'll be we do either you know contextual yeah that would that would hard code it to your instance too all right and then one other thing I think we probably only need the uh Slash record part because you're already in the audience network manager workspace yeah well let's uh you won't be able to test that though until you until you actually deploy it um yeah artifact it's a true statement uh so yeah it's artifact slash it's where it is where its root is yeah anything after artifact is what you need the context so it'll live here and we're on artifact home yes that's feeling a little uh you may want that late that slash do we need the slash yeah uh so the other thing that I want to do is I would like to be able to to dismiss the message oh and it uh provides us with a property already uh some action clicked yeah so if somebody clicks we get this action clicked message and then this is where you can put the X on there the X on the far right of it yeah so the x is on already so dismiss equals to true I think we're passing yeah the type is dismissed so I think we get a type um in this action type dismiss but I'm not seeing so I think what are the other types you get I'm looking uh well let's do this let's uh let's acknowledge open open please open dismiss displays an x button acknowledge displays an ok by default or unique button by putting in a label property open displays an open Button by default or unique button name using the label property all right so we're going to use this neat trick that somebody taught me and I guess we have to do a few things first okay all right so then if I click on the X ah so we know the name and then we it has a payload action type dismissed so I guess we need to go dot payload.action.type is dismiss and what do you want to do when you click that I want to set our show alert to false and then update the state so it goes away so the X doesn't do anything by itself yeah the X just fires this action and then you have to decide what you want to do wow that's pretty granular control let me say that nicely it was it was well set what was it action action dot payload.action.type cool there you go kids if you didn't learn anything today you learned a couple more Arguments for stringify yeah uh save yourself a trip to the beautifier what was that college show alert and then we want to go update State the state nice I don't feel quite as confident this time so we're just commenting it out [Laughter] oh okay [Music] and hey it worked right so I think I want to deploy this uh to the instance so now we get to after what's uh pretend that we've uh refactored it and everything um so I think I can do a now CLI deploy but since this is already in the instance don't I have to force it somehow to overwrite the existing one or am I am I dreaming that I don't know Let's uh I'm sorry what since I've already deployed it once yes I have to do is there a force Dash force force oh it is force use the force Brad all right so deploying your component blah blah where do we do we have Force documented um I'm sure it is search force on the page no it's definitely a command that's in there yeah I I have done it before um what if it's on here no well well that's a uh that's a thing that we can fix yeah do you know anybody that can make a change on the deaf portal the the right kind of people for that so it will um sort of tell you that you need a the command if it fails that's what it that that's probably how I found it last time is it failed and then it was like Hey try this all right so one question is do we have to do we have to add um the new one to the page or will it just show up updated let's find out it will show updated and will know because it'll have the job so none of it none of the servicenow bits have really changed the code was updated inside of the one record yeah and it looks like there were some things that were right so we deleted a couple of files and recreated them and then we just updated a couple of them and so yeah this is the I think yeah but you see how I deleted it but recreated it with the same sys Eddie very Jamaican coloring okay it is [Laughter] oh check you're making me laugh this morning that's good uh so let's see if our Link Works um uh when you guys have kids you know that they see the world differently it's a great attribute oh what happened we did need the whole no I think there may be there may be like an event we can fire instead of the opening a link there is a workspace um event I don't recall it off the top of my head but there is one um for this but this mostly worked but it it did all the things we actually wanted it it opened in a new tab it opened a new tab we don't want it in a new tab but I think that's why we're gonna have to use the event is to open it in a new workspace tab see if we uh otherwise a standard link is going to do is not going to do what you want hey James come help us I know you're out there jump on come join and help us because I know you've solved this exact problem yeah so let's see does he need the magic Zoom link I think he already has it right Brad uh I don't before so it did open in a new tab in the so it opened in a new tab I went ahead and changed it to add the entire string and so that opened correctly you know ideally what we want is to click something and have it open up here yeah but at least we we do have it opening in a new browser tab to wear it a new workspace opens the correct record but we're close um well do we want to switch to some spoke development and I can refill my coffee absolutely we can do that all right well I'm going to I'm gonna stop share and somebody else want to pick up share yeah now we'll pick up share let me downgrade my screen real quick before I do that much much less screen must happen for the screen sharing because 4K screens don't convey very well over no the YouTube [Laughter] they just don't all right share screen yes I'll continue to take the screen all right so I am creating a repo or oh this guy this guy because I'm gonna be yeah working this bad boy and adding to it and I'm actually gonna do what you did yesterday Chuck so which is so I've created the repo dump your current work into the Master repo in servicenow Dev program then you go Fork it unlink your Source control and Link it and then re-link it back yeah so there's there's a little exercise in there too that uh most people don't know that you can change the um Source control configuration we'll walk through that wrong creds that should be the right grids that should be the right creds hmm hmm let me let me check that and I haven't edited those let's go uh credentials it wouldn't be here if it was wrong but whatever we'll do it again pick that and then we'll pick this thank you am I doing something wrong that looks right e oh this looks fine uh why is it failing so your credentials are your connection make the connection oh well there there is no connection for the that credential oh okay I thought there was I'm thinking something else create a new one real quick let's go grab it from here again copy to the clip I think I have too many GitHub credentials um just long enough to make me nervous right okay I mean well it didn't fail immediately on the credentialing which is okay so it's in it's in the servicenow dev program one step two so so now I have my repo with the details on that bed and I've got the app in here it'll go to the about yep at about and then down here to topics we're gonna add Oktoberfest October 5th save changes don't you want a hacktoberfest 2020 in there too uh it only needs the one okay I didn't know I put both belt and suspenders today um so now I'm gonna Fork it into my own area yep so that I can contribute as a contributor versus the maintainer yep uh so now I'm going to do code and copy and um now I'm going to do what go to the Head CIS under repo under branch which uh we're just gonna type repo here and go repo configurations because SN utils is great and the one that you just did updated which is going to be your Oktoberfest also uh how's my screen share look on that one could be a little bigger um it's also it could also go down in to the right a bit we're picking it up right where the URL starts got it all right an ending right like at the end of description like that how's that Chuck I'm waiting for the YouTube to update Brad my oh yeah you're not looking at the uh yeah yeah that's good that's good leave her there for now okay okay it terminates right at the end of short description field label okay so here we can just I don't usually go in through this table but I believe you just delete this record oh uh yeah I could because this is hooked up to yeah I was gonna update the URL and the current reference oh you can do that you can do that yeah I can I can delete it it's not meant to be edited um so that was a good point let me let me do it the the polite way now now when you go to Source control it says hey I don't have a record for that and you point it to your forked copy that way to copy yep and I'm saying you are out and credentials and link to Source control there you go so if you're not familiar hmm the SN utils is really freaking handy so I was using the table lookup which is very very handy because I don't remember table names um so repository gets me repository configurations and CIS repo config which is what Chuck was saying and I'm surprised this this repo Branch didn't come up well let's type branch Source control branch okay but you typed in repo which yeah I typed the repository repository okay that's why Source control there we go Branch stash tag and so that allows me to get to the tables uh nice and quick with the filter turned on which I really like so I love loading with the sysparm filter only true I don't think that's documented anywhere it's it's documented at the very top of my internal of my uh Google doc for servicenow things you've never heard of before I keep that one at the top uh how to tail the log in a window and how to cancel my transactions those are my three things right at the top of that file we're gonna have to write a blog entry about all these technical tips and tricks we've picked up over the years because I've got a few of them in Evernote too yeah I've got a uh 30 page Google doc that I just keep adding to the bottom all right uh so now I have an empty app um so I've got a empty app here in my fork in uh GitHub I'm in my Dev program Dev you need to also tag this one as hacktoberfest or just the master one in the uh just the master one because the only the I'm only gonna do pull requests from this one into the master one and those pull requests are what's going to get logged from Oktoberfest contributions okay and you've already got some work there this is a private repo here um and no one else will be able to see it and hacktoberfest can't even read it it's only my pull request to its uh parent oh I don't think I made mine private I should probably yeah and you don't have to I just did because I it was the default and I didn't click anything else okay okay um so now I'm going to go to my agile board and pull a thing from the agile board and start working on it I thought you already had some work done on that spoke that you wanted to bring over um I have some work on so there's the servicenow YouTube spoke um and I was doing some work directly in that repo okay or in that app but in order to put it out into Source control publicly I need to make my contributions in a separate app okay so you do need to migrate any pre-existing worker you're just going to start from scratch I think from what I'm doing today I'll start from scratch on any new stuff okay and I'm going to leave the other work um because it's done you know the done work is done and I'm not going to do anything special it's just the the rest of us the stuff I do for YouTube uh is going to be through that app Okay small um so we actually did the clean up the live stream form that's over so what I'll do is I'll Fork a copy from the SN Dev program and then add my stuff there as well and then we can you know sink and Pull and clone as we need to all right um so what I wanted to do was uh I wanted to well the first thing I actually really want to do is this one which is not YouTube I don't want to do this one right now I'm going to do it right now I'm curious what that task is remember what Chuck wanted I'm curious too I think that's a recurring task so you're asking me to remember something so uh this this story was to um we've got a bunch of date fields and I want them to all be synchronized sync all date fields from update on planned publish nevermind so I'm gonna pick this up even though it's not uh even though it's not YouTube because I I really want this one done uh it's a pain point in my life and I want to do it now okay I am one thousand percent and supportive doing this developers prerogative artifact manager all right I'm in the correct uh scope uh and I'm going to go take a look at artifacts real quick to show everybody what I mean and then I will actually do it so what happens is we've got this planned published date up here in the top right and for YouTube and other things um it populates something in the title and uh updates these start and end times um fields and also another field that's not even visible so if we go to a real record which the next one should be what I want to have happen is when I come and change this to 21 I want it to change in all the other places that it was the same date as as this one was already so I want to change this to 21 I want to change this to 21. I want to change this to 21. does that make sense my first instinct would be a business rule but what are you thinking I mean my first instinct nowadays is flow designer right um that's why I said it to have this conversation uh because I love flow designer and I like it and um you know it lowers that bar doing the search well doing the search and replace in the title is not going to be too friendly in flow designer yeah but I'm gonna have to script that wherever I do it so true you can do a function on the on the field so I'll do a little function in flow designer I think this is the way because I don't think we have a quite a search and replace well maybe we do in the transform functions I haven't looked yet I'm gonna open up flow designer and I'm gonna say give me a new flow we're gonna do slow or do you want a subflow oh that's a really good question almost every time I want a subflow when I make a flow but um yeah this one it feels like almost almost too much overhead but we could use it in another place maybe it feels like it's a reusable thing that you might want for fields and dates I might want to invoke it a different way than a flows triggers update um date fields uh sync update appeals now um while you do that I'm gonna go Fork that repo artifact manager sounds good and this is to sync uh planned publish date start and end dates well you didn't call the spoke spoke toberfest YouTube I it that is that sounds right you wrote from our naming tradition oh did I really yeah everything else has been Octoberfest underscore something well we can fix that without messing up the world what did you say I needed to just put spoke toberfest underscore I don't even know if we have a YouTube in here or not whether you want to leave it as you could have spoktoberfest YouTube where you could leave it as booked over efest YouTube enhance I like that that'll work yeah all right it's already interrupt no problem all right so the inputs are going to be an artifact you have a record which is a reference to the artifact table and that's it right and the output is going to be ooh do I wanna yeah I wanted to update the thing so I'll still send the artifact on the outside why might I do it this way oh oh oh oh oh oh you may want to send in like old artifact new artifact that's what that's why I'm doing input and output no no no this has to do the work like do the search and replace you have to know you're searching for the old date in the title you can't get the old date this way you have to pass in previous basically current and previous to a business rule this flow doesn't know what previous was or no you'd be passing it is it passing in previous or is it passing in current when you change the date it's going to know the old title I'm just mentally thinking through this or what it knows and what are you going to have to replace so what it knows so if I use this in a flow the reason that I'm sending artifact on the output is because flow won't have the updated artifact right okay accessible you only have the previous flow values because it it stores those so if I want to reference those somewhere else in my flow further on I'd have to re-query yeah yeah you don't want to do that and I don't want to do that so that's why I'm passing as an output my artifact yep got it things you got to think about when you're doing the flows um so the action I want to do is update a record and I want to update my artifact record and the fields I want to update are the start date the end and I don't I think the other one I need to do is actually already a business roller flow start time is syncing with another field uh for the calendar sends um and so I don't think I want to mess with that logic yet um short uh title title it's in the short description field but it's the title yeah so here what we want to do is these are date time Fields right these are daytime fields and I just want to modify just the date part of them oh yeah it's going to be interesting and your your input is a date field yeah so um what I want to do is you can just want to do that actually [Laughter] it's either script or custom action yeah I think this is a script or a custom action here because because I want to keep the the date um or the the time part but but modify the date part right um although yeah it wouldn't be that much script so yeah in the data pill um just so I can take a look at it I'm gonna jump over and get a handle on and look at FX and see what's available for date time stuff uh not much uh add time string to date and subtract time hmm you could do a date to string and then parse it but your output is still isn't gonna help with that is there a concatenation in the strings there's a trip no and split substring but now what I was thinking is you take the date and the time you do a split on the space you take the first element and throw it away and replace that with the date oh man I'm really wishing for some Quebec features now darn it I got it yeah this week so I think I'm gonna need a let's just do it um a custom action for this which is fine we can build a custom action yep um I'm looking up some methods for you that might come in handy let's see we're going to uh take date and return take date and time um date adjustments so Glide date time does offer you a get time function so you can get just that so we're going to take in both a date and a date time talk about your specialized actions uh so we're going to take in just a date and we're gonna take in big time and on our output we're just going to have a date time um I like having my plan for what's coming in and what's going out and then then matching them together what do we need now we'll go rip do a script and then we're going to create a couple of variables and then we're going to create an output variable and this is again going to be our date I might recommend a different name for this action coming back in two years that's going to be very vague of what it does oh yeah absolutely I I just was horrible with the name so I'm gonna have to like replace date in date time or something oh it's like they state or date time that's very descriptive of what it does I'm sure there's a property to add a better description like text that says here's your inputs here's your outputs here's what it's going to do uh why is that say undefined um there's a weird bug in Paris if you cursor over a data pill it will do that if you're dragging a data pill and you hit another data pill it'll do that it's just very bizarre learned that in a developer Meetup proved it on my instance too adjusted daytime is my output okay yep and I'm going to link that up into there about a thing and we're done right no not a good thing so I'm gonna visit one of my favorite places the developer site we're gonna go to reference we're going to go to server scoped we're going to come down here and we're going to type time [Music] no and we're gonna collapse calendar glad daytime come on buddy no you don't want to close and I'll show it to you but I'm not gonna not show it to you Glide daytime it is not much of a reference if you have to it's like how do you spell a word in a dictionary we'll go look it up in the dictionary all right so uh we need to um we want to just change the so we yeah we've got already got a date so you want to get time set a date so get the time component out of it you won't buy it get time I want to see if I could just set the date part I don't think so that's why I'm looking okay that's it unless it's undocumented which is perfectly possible but we'll come back to set set value at the end yeah all right or set display value it's your choice would you want to deal with display values you can get the get the time time and then well I guess put them back after well it's going to get an object so you're going to need to stringify it with that get by format so back in flow designer let's roughly do that so we're we're going to get our time and then now we want to set our time I recommend a set not display value you'll run into a time zone offset if you just want regular set value or set value UTC or local time I don't know if set value is I thought that was deprecated uh it doesn't appear to be so okay works for me uh uh we can do UTC which is fine and then we're roughly going to do set that and um Chuck can you uh fill a little air for just a moment fill a little air all right well while you were waiting I went and copied the YouTube repo and then I am going to start manually importing the four or five actions that I had built so maybe when we get back from my meeting in half an hour we can continue with that and then we can do sort of like two developers on two different instances working on one repo and we can sync up those pull requests and whatnot that'll be fun we can still pull it all together give you that uh illusion that we're actually doing some work as a team Dev oh that was funny um so sweet thanks for doing that check so now uh we need to do our inputs.date uh and we're gonna you know let's set that to something uh how about uh oh original date sounds good I tried to stay away from variables that also act as keywords like date yeah or functions [Laughter] my date old date whatever earned too much on that all right once in a while I'm glad date no we already have a glad daytime object so we don't need that part do you is it an object or is it a Glide element object because it came from a field value object anymore because once it gets passed over here it's it should be a glad date time object key operative word being should be uh give it a try see what you get and I'm going to go under the assumption that uh it is uh it's doing the right thing it doesn't work we're gonna need first otherwise yeah we're gonna need to if it doesn't we're going to need a new Glide daytime and then do a set value right so we we would just do uh you know orange daytime is new Glide daytime of inputs.daytime if we need that I'm not sure we do right now so get rid of the GS info replace that with a variable yep uh so we are going to set this to we may want a VAR keyword on line six yeah um so let's uh call this our um new or uh stored time short time equals GT I can get that into the format yep uh so that should take our original date time and dump it into store time and now we need to uh we're going to create a new gladiate time object which is fine concatenating the the two other objects that we have right now right right so we want to we can just set we can just do this right here we don't even need to set we can do it here which is you Glide org and stored time you can do your Glide date as a get by format also so I can do it this way or I can take this yank this out and put it down get value returns your spring as well explicitly set it that way um so or I don't think that's going to work because org date isn't a string oh you're going to need to do a get value or get yeah format from a Glide date from glad day good call date that value should return a string or get by format any way you want well we'll do the explicit one it reads better for sure say oh I know what that is yep um and we're actually going to do that up here yeah um let's make it year month day oh um oh yeah can you do input date dot get by format or this is where we're going to find out if it's yeah this is what it will quickly find whether or not this is a cloud day it it's got to be though it's got to be it is that in place of GD by format you think so complete work I am optimistic today optimistic Prime he's one of the Transformers I'm optimistic Prime today he's like he's like Happy Care Bear [Laughter] so yeah do you trust it to work in day month year format what do you mean instead of year month day when you do a set value I think it prefers it year month day you get me telling it how I'm sending it can you do that with set value yeah copy this straight from the docs oh there you go okay that works then I'm okay as long as it's consistent eight times they're all so much fun Let's test it uh where is my test window am I missing it I don't understand why I missed it I was typing a response in the chat I'm gonna close it and reopen it um action and action okay test okay so let's give it a date which is last Tuesday and we'll give it Thursday at 6 00 pm 30. and you expect the eight to be replaced with a six yep I expect the output to be uh part of that right here okay doesn't matter if we're going forward or backwards and Oh missing semicolon well that sounds believable let's go take a look uh my mind's had one where are you have an extra parenthesis on line seven of course I do of course we do you know how I spot those real fast I've done them a lot recently and if this is my uh not my last test I'll be setting a default test uh values all right can't find fun function get by format okay well yeah all right uh whatever who's consoling uh the line number doesn't get by format okay sure thanks auto complete intellisense yeah so uh that's fine well the first thing I'm going to do is set my defaults oh very good I mean testing faster is that the only reason yeah that that is that is absolutely the reason good enough motivator for me it's good enough for me um so we need to uh create a new um uh well they object it's not all of them are objects uh formatted new glad dates of inputs.date and then um we want to we should be able to just get by format wherever I'm calling that now but I can I can just set it up here um I meant this to be that and then is for day dot get by foreign so that also probably means I'm going to need to do the same for this guy maybe [Music] so we're gonna do new yeah because it's not a guide date time I'm skeptical whether that's gonna work or if we're gonna have to do us a naked one and then do a set value this one should be fine because it's using a glad eight time object yeah save should be fine dates and times are always the funnest thing to do said no one ever test some interesting quotes going on in the chat and the argument string not found three yeah that's kind of what I suspected because it's not a string it's a date object but it won't use date object commands on it you but you could use it in a set value if I'm not mistaken all right so instantiate it empty yeah killing me I know killing me guys that's what I suspected now do or get that set value set value you may even want to do a two string on that dot two string on it yeah just to be on the extra safe side and then same probably the same one here yep so yank this out they drive me crazy why do I have to set the the object type if I can't reference the object type here oh because I'm setting the object type in the I think when I'm passing it through here that it's not so I think my action actually understands the object type but the the script step doesn't okay you might make a little more sense that would stand a reason ah set value all right yes foreign I deserved that one uh save this save it and run it I'm so glad I set those defaults and ah what now what could not be uh it passed it in look at what it's doing it's doing year month day and you're saying day month year because it's unparceable because we set the wrong format I didn't see you need to change it on your set value where did I that value or I did get back by format and formatted and then I oh thank you okay that'll help I did format it [Music] oh the where's we didn't get an error that's shocking let's hope we got some output did we get an output the output uh should be I didn't see a returned value there should be a output here buddy did we we didn't do an upwards did you I created one but I didn't set it yeah the script needs do outputs dot whatever yeah yeah we all do this all the time too I I almost set up all the inputs and outputs for everything right I was really close you were on the right track I'll give you credit for that was almost all of them wait wait wait wait you didn't set a variable you're doing it you're doing this oh yes you need you need GDP to like start this guy yeah yeah equals equals gdt do you need the name your name is all lowercase oh yeah you need the name copy the wrong one copy pasta but no no no no you can't set it to gdt that's an object oh but you are you're returning a date time never mind I'm returning a daytime object uh if if that gives me a struggle uh me and some input output objects are going to have a have some conversation [Laughter] and I know who's gonna lose uh so now we just have time zone issues we have time zone issues because that is the right time and date but well it's a good thing you pick something early in the morning so it would do that but shifted yeah so what do we got so one of these is setting this not as uh so one of these gets or sets is not respecting the same time uh Zone format so let's see I've got a set value UTC and I've got a set value not UTC on the Glad date time so so try just a second oh okay um because that should be enough to fix that problem because they're all running you may need the third one though one on line four also there was a one in line four set set date uh the the date will matter it is time zone aware no runtime value yet oh no somebody doesn't like a UTC yeah he's uh upset that this isn't a string so do a two strings you would have yeah [Laughter] hack it our way through this one yeah that's his string still curious about line four yeah and then this Glide date that's Glide daytime Glide date have a UTC equivalent looking looking blind date what is it set value what's that value um no no it has a set display value and a set value so leave it as set value since we're not dealing with display values anywhere that I can see unless it's coming in as a set as a display value hey at least we're finally at where we should be with with date time issues which is dealing with time zones where we should be somebody doesn't have a set value UTC like date time doesn't have a set value UTC yes it does is it uh set value no t z there's a set value I I mean I'm using it further down it has one um takes two arguments um so I maybe I just need to pass it the the time string and the format string are those required it appears so it's the UTC part required local time does not have that ARG and set value does not have that argument it is a required parameter it is a required parameter okay well then I'll give you I'll give you what you require I'm with I'm with wizard of Floyd abolish time zones when I become emperor of the world there will be no time zones uh and they can work really weird hours inputs that daytime is going to be I'm gonna need to get the thing by a format in order to set it uh yeah I don't know I don't know what it's gonna give me well I actually do know what it's going to give me it's gonna give me this that's what it'll give me by default you're missing a year you're missing a y that's my glasses four wise okay my glasses are darn astigmatism looked like three uh I wonder if it's gonna be angry that I'm not daytime join us for exciting hour two battle dates we've got all dates times um I probably need to give it the whole thing because this is a Time object ugh this is so disgusting now what do people struggle with in service now uh yep still off by the same amount okay it feels like a different value setting the UTC on line 15. really feels like it should be a set display value because I think our inputs are display values which doesn't feel right but it may be so you could do a git display value on the output I'm guessing I need to do set display values instead of set utcs or the final one on line 15 when we put it all together well this one has got to a line oh okay they have to be the same for sure I'm thinking it's the date and the time I don't think it's just one foreign potentially they won't need to mess with this one too but um the line seven and line 15 need to use the same process so let's go uh and that's what we thought we were doing set display value string format all right that's it display value and there's two versions of this one is just one is a one argument that just has yeah and I'm going to do the two argument one because I've got a particular format uh uh that's better now we're only five hours off I like it [Laughter] uh what happens if we're not near is this which one is throwing us off um let's I'm wondering what inputs.date.2string is really representing it's a 21. where the debugger would come in handy yeah we're still five hours off but the other way around the clock hmm [Music] well I've spent all the time that I want to spend on the screen with this you know play YouTube will I jump on my other meeting for a while yeah because that's what we really came here to do it you pulled an Arlo guthriano's that's not what I came here to tell you about um right can you take over for a few minutes sure I can uh I can show something [Music] I want this desktop all right so James sent me a message saying if I wanted to open up a new workspace tab I can use I can dispatch this preview record event oh so I have come in to our create artifacts succeeded and it's going to show the um it's going to show that error but then we're also dispatching this preview record event and it looks like it works I went ahead and tested it so let's uh we can test it here so interesting new tab and then it automatically opens it in the new tab so you didn't do it from the alert you just did it right from the yeah I did it right from the because it's a it's an action that we have to dispatch yeah so I don't think I mean it makes more sense then you'd only need to display a message if there's an error yeah I don't I don't I think we can get rid of the uh the message from here so I also realized that unless there's an error what would what happens if you if your record creation fails yeah that's a good maybe we just changed this to be uh earlier certain condition I did notice that we did exactly what the usage criteria told us not to and that I have the little Caution icon on the blue info that's the learning icon oh this was the exact example that it told us not to do so all right read the usage stuff and then also uh also James enacted yeah so that worked that was good um do we want to poke around in the uh uh repos a little bit let's see what we have yeah I'm gonna jump and I'll be back as soon as that other call is over and then we can do this tag team thing so I'll catch up where where you are when we get back all right thanks Chuck you're welcome talk to you in a little bit all right so we've got uh we've got a couple of uh uh GitHub orgs that we're using for hacktoberfest one of them is components specific that's the one I'm showing on the screen right here uh and that's the now components dot github.io is where you can get information and it's got some info on how to interact with it and then it has some info on the components um so James added this really cool font awesome icon component where if you want to use phone awesome icons instead of the icons that we have out of the box there that's available um oh Nia added this KB approval card component and so this you can do an approval I was actually considering adding a com an approval components um because that seems like something that you would want to see on a landing page so that's cool uh and oh it looks like this one I can preview it by clicking on the little I icon and it'll give me a preview of the KB in a modal so that's pretty cool uh we have Pages Spotify component which shows a Spotify player in an iframe it looks like and then my to-do list component that now looks very different we need to change the screenshot on it um but let's uh let's click into some of these uh so let's look at the approval card oh we gotta go the other way so here is the org and you can see that we've got a few uh we've got a few repos in here now um one of these uh uh here let's look at the to do and we can see that we've got some can I just show all the pull requests there we go so uh J deep deb405 has been in some of these repos and has done a ton of stuff uh here including um including uh you know making some visual changes and lots of different things to my to do component um what is it do we have one that has more pull requests let's see we've got the my request component uh looks like this was just the initial commit anyway lots of lots of components in here we've had a few people uh we've got some maintainers and some contributors and it seems to be pretty uh working pretty well so that's the components we've also got if I can get my there we go we also have servicenow Dev salary that's not what we want so we've got a number of spoke toberfest repos on servicenow dev program and then we also see some other things in here what if we yeah narrow it down to repost with the tag so we've got um to do this hacktoberfest tag it there's more there's more of them oh does that that's the uh only 45 000 so yeah so that um the global so clicking it they are narrowed it down to that that for everybody and not ours yeah so let's go back and click it here there we go so we've got a number of uh number of different spokes to contribute to as well as the uh points thing for Slack foreign component examples repo which is I think it's got what six five six uh service now developed components in it uh if you want to some of them are fairly Advanced if you want to poke through those and see how they work yeah they're they're pretty great for um because they are workspace Centric ones so they're meant to to be embedded in workspaces not landing pages so they're meant to interact with workspaces directly yeah I think I have clicked through all the pages what should we do next so do you want me to pick back up on working on the date thing or should we do some YouTube stuff or do you want to work on let's do some YouTube stuff all right so I'll pick the screen share backup if I find the right Zoom share screen yes desktop one with Brad off to the side there we go uh so let's go back to my uh backlog here and uh we wanted to The Next Step was working on this so detecting the current or the the published parts so adjust YouTube spoke and in a integration to update artifacts when published I thought we didn't we find out that this was happening I think maybe something else I thought maybe it is but we're gonna look and if it's not um well even if it is I'm gonna move that logic from wherever it's living to be centralized um because it's probably a business rule or a scheduled job um so we've got our artifacts and so artifacts I need to do it on the right instance not that one so when we're in the ready to publish State and we've got that YouTube integration that is pulling down uh these YouTube video records and here's the published one for the 10 10 so it was Friday because that should be Fridays right yeah it looks like those are the most recent three are all the same really those two look the same they shouldn't be creating duels I think they're all if you look at the video ID oh the video ID is the same well that's that's definitely something to fix oh four of them oh we got an issue here this might be our new story there's 18 000 of these that's not good I don't think we've done that many YouTube videos I'm gonna go with no we we haven't uh I don't think there's any business rules on this but let's check yeah so this is generating the artifact from YouTube video and that might be uh something that could go away too but for the I think it's a scheduled job foreign so we've got this refresh YouTube comment that runs daily at three o'clock in the morning that seems right and so we're gonna open up this script and I'm going to close out some of these other windows and which uh what we're calling process my uploads this is supposed to do an upsert um and shouldn't be inserting new ones shouldn't be inserting new ones that uh have the same um ID so let's take a look at this because this is this is bad shouldn't be doing that um items tokens all right so get my uploads and then um process video items so create or update video record so this is our upsert and it's supposed to be going off of the video ID and narrowing it down to item dot ID so we're passing in the item and so we should be querying this YouTube sorry this one two here this table based off of one of these okay so here's the ID field which is different than the video ID and so here's the videos ID and what we noticed right Brad was that this one is actually the same as this one but it is different than this one yeah but the video IDs are all the same and so this appears to be our unique identifier not this whatever this is yeah I don't know why that one's different and then the other three are the same yeah it doesn't seem to have a good reason it's all the same YouTube record with all the same content the ones that were the same have the same published at date and the other one is different but they're all updated on different days yeah I think uh video ideas yeah yeah so I think we need to adjust I'm not sure why we have to adjust this it seems like YouTube has changed their API is what happened and so instead of querying ID we need to query on uh the video ID field which is this thing which is video underscore ID check says stick with video ID he's in another call and also unfortunately um and this is what we want right for that query is this guy thank you does that make sense um we're now querying the video ID field with the video ID yep and then everything else should be fine so that's good there and I'll test this uh separate um but back back to our story now uh which is I wanted to and that might be uh part of what uh the auto automation uh so there's no business rule on this that's updating the published part but I think maybe we had a flow that was doing it so let's go take a look I think there are some YouTube flows and so let's see if there's a publish name in it all no uh how about just YouTube or video update you know so that's getting the stats that's the description get stats update the record nope um maybe it's a subflow publish uh video live stream YouTube nope okay uh so we look better over here now uh one time sync video with live stream sync video with live stream let's see what that one's draft one does laughs look up artifact records for each item in YouTube video records so look up the records okay this is in the video one hmm draft contains published contains all right for each item update the artifact record okay so this is setting them to published so I think this one is doing it it's just not uh well could it be the other one there was another one that was sync video with live stream but this is this is that one-time logic where once I match up um run once ugh really open the other there was a sync video with YouTube different flow there was let's take a look at that uh it was right under the window yeah there it is published yeah so when those records are created there looks up yeah all right hey I think we did it victory and I think the reason why I thought we hadn't is because we're having issues with the yeah with the video IDs syncing correctly um let's make sure this is triggering off the right thing which is the video IP on the trigger yeah that looks right wow guess what I'm gonna do boom I'm gonna put it in testing so I'll have to pick up some testing um the next thing that I wanted to do with the YouTube scheduling was what did I want to do next with the I didn't uh I don't think there was um oh I needed to finish the upload one do I even have that one I don't think I have it let's do that we're going to create a new story and welcome to up going on damn so what I wanted to do here is leverage the new YouTube apis because I built this myself previously and it wasn't quite right um so I never deployed it so we're going to upload uh attached attached video to YouTube and this is going to go in artifact manager yeah so I may or may not need some YouTube spoke editions I think I might have everything I need so created or updated on artifact table States changes to um I might need a you think I should do ready to publish what are what is this going to do upload this is going to upload in an attached video to YouTube [Music] yeah I think ready to publish is right or should I have a different state or I think we're ready to publish so that uploads the video to YouTube and then publish would actually which is do I want to for those instead of it being an artifact do I just have the person create a YouTube record and Trigger the automation off that instead of in an artifact hmm because we don't really interact with it YouTube record table right but we're starting to a little bit um foreign but the type is video and moves to ready to publish and I think the only time this will happen is when I have an attachment but I want to see if I don't think there's a way to check to see if I have an attachment here so we'll leave it like that for now Chuck made a good point on attaching a video to a record in the chat if you've got a pretty big video it may take a while to upload the attachment into the instance yeah it will why don't we why don't we start from YouTube Just uploading the video to YouTube uh because this is for other people who don't have ability to upload video okay right so this is for people who want us to post a video and so we're going to put in some approval logic to even get it to like only you you know only your approvals will be able to and in fact we could put a approval in here right now yeah in fact let's do that oh it's not task based uh yeah and this one do we want us do we want to add an approval State then instead of ready to publish like the they would so they would want to create the artifact yeah really we would we would just give people like a record producer that says you know upload your video they attach it to the record producer and say I want to push this to YouTube and then then we would create let's go ahead and uh adjust that date um videos um or do we want to have an approvals we need an approval state or an approval field anyway um let's create the approval field yeah I do I mean do we want some sort of request like before it even becomes an artifact got I don't know that I want like rejected artifacts um I that can be as so yes but I'm solving the I I have attachments on artifactory like I already have this process I'm already doing it um I'm just trying to automate that part of it right now which is uploading the video so I have artifact records in which I have to download the attachment and then upload it to YouTube and I'm automating that bit right now okay why don't we just why don't we just automate that bit and then handle the approval and everything in a like in a previous state yes I've really okay um so YouTube uh which is upload video and we want this is the um so I'm gonna need to do a look up first of the attachment look up attachment and I'm going to need to look up an attachment on this record and it's their lookup attachments why do I need to get attachment record get attachments on returns a list and count oh that that is named poorly get attachments on record was that what it was called on the list yeah yeah I read get attachment record and I don't know the file name and this is going to be I'm still going to need to do something to this right yeah I think you may need to Loop through them and then grab the ones that are because this is a list of Records yeah get a record out of it actually I just need like the sis IDs of the records I wonder if I can like take this guy yeah and do this transform to a string on this bad boy get item from array no I don't want a complex item I want like just hmm [Music] this complex data have a something to string get item from array yeah I just want single I just want a society I don't I want the the zeroth item and then just can I also then to string it like I do I want to turn that object into a string what if you click on string on the left do we get more options no let's see what it gives me and then this is gonna be enter a URI let's go look to see what the uh thing says no that's not what I wanted I want uh can you show me the the words I want the words for this the set video metadata action you have to set the metadata first okay all right yeah okay so we need this got it well that makes sense so here um I guess we'll do it inside of this well I don't think we ever actually stepped in there because you grabbed the first item in the array yeah but I think I'm going to move that in here and do that set video data and the title is going to be here and description is going to be do do description public and yeah well that's fine done and now you are gonna go here you're gonna go away and then this is gonna be uh Now set your okay and then this is get items from array and item on attachment I need record here not so this should just be the record Society right yeah then I don't need to do anything sneaky and there's only ever going to be one but that's okay I think that's all I have to do get the attachments off looks promising uh no this is the yeah get attachments on the ring yeah I thought for a second I'd put this as the uh artifacts this idea that's not what goes there this is the sys ID of the attachment that's on the artifact which is what I need here the actual attachment itself and then um we're going to should we set it to published or should we let the uh sync do that um I feel like we should probably let the sink do that I think we can let the sink do that so the when when it detects the YouTube video exists um what I should do is update at least the uh URL on the artifact right yeah because that's how it's going to know to sync because otherwise it can't sync so we want the uh planned published or the uh What uh URLs the draft URL is going to be a returned object this guy oh he's inside of the thing I need I guess I'll just move this inside you're moving inside buddy we're still only doing this once but whatever it's fine and we should get a video ID bet actually that's not what we want we want we want the video ID you know because the video ID is the it's on the video record yeah so we do want we're gonna have to like do what is the URI it's a good question let's go take a look foreign and location is that we might get that back from be the YouTube endpoint for the video hmm but I'm not sure I'd have to go take a look at the this videos upload because I'm not sure that those are the same thing so I'm gonna set it the way I know it'll work and the format is just uh should just be let's go look at one of our existing ones yeah so looks like that watch and then we're plop in the video ID here done see and I'm not going to test this because it takes a really long time it's on the stream because it's uploading a freaking video but this feels like the right thing so I'm ready to go test this so you ready to take the ball for a little while uh yes Yes actually sorry give me two minutes sure so let's take a look at we can go take a look at this API and and see if maybe I didn't need to do that shocking I have been on this page before upload a video and so simple I want the this is not the page I want actual like API page better I'm gonna go insert uh videos upload resumable insert video yeah upload and what we get back when we get back that's our parameters what do you give me video resource and we said location where's location in this right it was location okay I am back processing said Mars location are you testing it I was looking trying to figure out I was looking at the API on the uploading that metadata to see if there was anything like I'm not actually sure it doesn't have a locations here so I'm almost so in their API I don't see yeah it said one of the headers is location yeah and well inside I'd have to inspect that so I need to run this and inspect it and see if what I get back is actually a URL I can actually use so I'll finish looking at that and you're ready to take the ball yeah I am Let's uh thank you foreign looks like you have the ball yes let's go over here and we'll zoom in that's too big um so I think one of the things I want to do is a little off script um but I want to be able to easily push out our blog posts by two weeks and I think I want to do that with the workspace equivalent of a UI action which maybe is a UI action they are they're they're still UI actions they're just and you you can get to the configuration out there in the little Dottie thing can't you yeah uh I thought that was up there oh at your name to your workspace all right so well let's let's Google it workspace UI actions yeah uh so this is on a form list item system definition it's just a UI action all right so we're just going to create a regular old UI action that pushes our date out uh two weeks so let's push I hate the name of this UI action I will probably change it at some point artifact is that not the name of our table um foreign so I want to put it in the list I'm going to want to multi-select we'll make it a list choice workspace oh it can only go in the form and workspace I believe oh okay it doesn't help me if I'm on the Forum I'm just gonna change the date at that point so there are no contextual ones at all I don't think for the list and I had thought this was the case so the thing you can do is hit the edit button and I guess we could just change this I could just change it here quite as as good as I wanted it to be yeah because we wanted to like right click move it forward yeah hmm interesting what else do we have that we could do oh um um it would we probably don't want to do this but a potential way around that would be well no that would still be the form View uh so to have a workspace yeah now that'd still be the form View a more long-term thing that I've thought about is just creating our own component for the landing page that lists the artifacts and gives us some some of our common actions from the list that we want to take on the artifacts but yeah that's a uh that's a longer term thing than we can do this morning um I guess let's look at the backlog you know Chuck had some stuff he wanted to do when he gets back do you want to pick up on the uh and and maybe I can pick it up uh if you want um I need like 10 more minutes before I can pick up something though um uh you want to look at the artifact uh creation blog creation from artifact manager one oh yeah let's let's take a look at that and if it needs much more if you're still going after 10 minutes I can pick pick up in the middle there yeah let's do it so this was I think a subflow where we are creating a blog post in GitHub from an artifact so my subflow it takes in an artifact and then the output is a URL so we've got a custom action here foreign so in our action we are taking the artifact in and basically yeah we're building out the stub so this is the format of our blog post it has the stub up at the top and that's where we set the author the title of the post the date the slug so this is blog dot do slash whatever we have here and then any tags and then we're going to set it to draft is true so that's where we're building this stuff I think we might be like really close on this one I'm just I think we are not sure if it's fully I think we may have successfully maybe that subflow's done and it just needs to be linked into uh LinkedIn yeah so then we are building the header and actually sending to GitHub and then the last one here we're just updating the artifact record yeah uh so are we calling this from a flow yet when do we build this yeah that's the thing I think we just didn't link it up yeah I think we just tested it I think we tested it and stopped oh so that was the beginning of September yeah I don't think we have a flow for it um we should probably test it to make sure it works huh so let's create a test artifact okay foreign I think that's about all we needed uh well let's add a planned published date that's not today and we can look at the inputs and see what other inputs it needed but yeah I think that was about it um oh we can't do it by the what did I call this testing blood creation I thought we might have oh yeah this is Dev and yeah it probably is not got that credential this looks correct though that that stuff looks good though yeah so let's build a trigger that does it and then we can get the credential in here but we can go ahead and work on the trigger flow um so what do we call the create blog in GitHub do we have artifact manager synced or was that in an update Yes somewhere artifact manager is synced and it is currently Like It Is Well synced right now nice as of like this morning all right so when do we want to send it maybe ready to work are we ready to work that's what I think uh so probably something like ready to changes to ready to work and doesn't have uh draft URL all right so no all right so the output is the URL all right I think we need to update anything else [Music] um um draft URL really is the the key trigger here right is that's what we're getting back that we want uh so I think that's it is it's changed to uh you know ready to work and the draft URL is empty and then after this is done the draft URL is not empty and we're ready to go uh that seems about right uh uh do you want to take a look to see what it would take to uh push a update or put some content in there if there's some content in the record yeah so we wanted to so yeah if we want to update that subflow to be able to grab the content from the content block and put it in the content area of the thing at creation time yeah I I uh I don't love using the content field because it's HTML I guess we could just get the display out of there um yeah well it does it doesn't have to be we could use content yeah that's one of the other it could be whatever field Brad wants it to be yeah I mean I think that should be pretty easy Let's uh our blogs are written and marked down so here's some beautifully written markdown let's go take a look at our action that's creating the stub it's this one hmm yeah I guess we can because if there's nothing in the abstract then we just wouldn't put anything here please I think we need to abstract foreign I think that should be it let's see uh let's yeah we can at least generate it yeah we can test it a rough approximation of what it will be generated uh where's my subflow this is oh this is the simpler oh that's right foreign all right so when in doubt refresh the whole thing and then change it oh that's right we're processing the whole subflow so it's not gonna but this should work but it did not did I save my I did oh do I need to publish the action yes because it yeah well it's just just the action yeah if you yeah that's what we should have done in the first place the flow will use the unpublished subflow version if there's a published one that looks like it worked should we add an annotation here that shows up or maybe a field message that shows up if this is a blog post that says hey the abstract is where you would put your mark down yes why what yes I think otherwise I'm gonna forget in fact maybe not even annotation why don't we just change the label with like is this do we use it or something for anything else for blogs no I'm saying for blogs like change the blog's just a type yeah but I'll just use a client script to change the label all right right I said client strip okay very often so I'm not a fan but I think this is one of those times where I just want to change it right let's do some client scripting I'm back hey Chuck for coming back Chuck good stuff come in and go back we're gonna change a field label with the client script so where does one access the log down file I mean we're going to have a a link to that or you just gotta know or and and do I have access when we create this stub or do I need to Fork that and then pull request that back somewhere what's the mechanic of that look like so the first pass we just made on it Chuck was that you could paste your markdown into a field okay it's just an attachment all right we couldn't also do an attachment part but that's that's what we just did just now was uh you paste your markdown okay and that's reasonable that goes in the abstract field uh yes yes and we could probably have it generate the abstract from the podcast record yeah eventually um is there a g form man it has been a long time since right what are you looking to do we're going to change the uh play label the label oh I don't know that that's a uh I shouldn't have clicked on that it said Jakarta uh set label of what was that um change label of I really don't want to do any down manipulation new new I think I think maybe we use a field message instead of changing the label uh well let's let's let's first look at the G form API and make sure there's not a uh I don't want mobile or it's just quiet foreign she is only 39. 9 half of them are probably hidden so label of is there a set label that's what we're wondering yeah labor love it's an actual factual deported thing there's one we've never dealt with before all right let's try it yield name String label um oh yeah I guess we could have just uh field name is abstract did you want a condition on this of some type like yes markdown yes we sure do I just relabel the day of field uh uh let's go down after markdown is fine I like I like black markdown okay if G form dad get value something something I want to make sure this is gonna work first yeah yeah condition less unconditionally change that label look at that it did work I saw it there was a reaction time in there I I kind of love that there's only one client script I don't use them that often either look at that long name is it just type oh I think we answered that question last episode or the episode before when we were doing the drop down list I'm pretty sure it's type uh let's just guess and see if that's it Brad's feeling risky today let's just guess all right that was not it cursor is so type it is type but the value is value blog uh I would have gone with blog we can turn this into a game show uh what is blog for 200 foreign [Music] for the hour yes that label of who knew hey that's pretty great um what yeah I think that's good to go you wanna you wanna just uh do you want to move the credentials and and do a real test or do you want to just save that let's just save this we've got a little under an hour left and I know Chuck wanted to do something uh what are we this is what we need to publish I think we're all up so yeah foreign well that was easy assuming that it works when we move it you want to go ahead and commit that code at least sure very nice don't commit any of Andrew's changes partial commits are pretty tasty [Laughter] all right does this look right once again issues these are those are from the flow designer stuff right yep all right close tada it's a wonderful thing you Tada before it completed I have faith it's a big app your commit's gonna take a while I think the bigger the app the the longer it takes the fewer commits you make hey let's publish every day no it takes like an hour oh all right success there you go all right okie doke sweet thanks Brad yeah Chucky ready to uh do some uh do some youtubing can be I can be I'm just kind of looking up a cheat sheet over here see what I can get flow designer and Studio on a different screen in case I forget because there's some good stuff oh I'm on the wrong instance that kind of blows you know when that happens I think I've got my credentials set up I'm gonna do this off my PDI but I'm going to reproduce work I've already done rather than import it because it's done it's one of those things that you know if you do something the second time it always turns out better most of the time all right I'm going to do a share screen we can this will stop the other screen sharing do you want to continue sure do and I want to share that desktop let's see how well the screen is aligned how does that look I kind of that's pretty good I guess tomato based on our adjustments earlier you know three hours later we can figure this out yeah you have just a tad we can't see the X on the message but I can bring that in it's all right I can bring that in come on trackpad go that looks good better okay so I pulled down the YouTube spoke from my repo which is forked from the same repo the empty repo that we got before nope that's my original one YouTube spoke I believe that's what I'm going to be replicating boy that looks familiar okay we'll go with that uh this is my source material and let's do a file switch and my PDI should have not the one from the repo I guess I didn't pull that in so let's go import Source control to do GitHub from me thought I had this set up I had it set up on the others my fault repos YouTube enhance can't see behind the camera there we go uh that master credential sure that looks like a good description for a credential and I should get a big empty slag Heap I want to check my other instance because this should be a very very close approximation to the select application YouTube enhancement spoke meanwhile on another screen shot's doing a file switch come on to my old YouTube's book which thinks it has things to upload no this is the same okay good I don't need a separate screen I can do this All Through studio if I have to so my methodology may be a little different than yours because my my thinking starts from the credentials in that the API key is a better assumption than oauth for system to system Integrations we have oauth it's tied to somebody's user account and credentials and you know you can run into retry and expiry times and whatnot so I went and generated a an API key for my YouTube API key credentials click what is wrong with my clicking skills today so I have YouTube API key hey look a new version of stream deck is available on the other screen squirrel uh we want YouTube and hit some spoke and apparently I'd put this in the wrong spoke so there's part one of our problem we need the API key out of there not going to change this because I can't I can pull this down I'll redo the credentials later it's going to flow designer and build because right now I have absolutely nothing flow and low some more we're going to start by building out some actions and actions that I had once upon a time thank you What in Green Acres is going on over here okay I want to do a simple look up a video so let's do an action actually I don't think I have anything in here my old YouTube spoke look up videos look up video okay that's not a good description this should be a simple arrest request I'm sure it's a single video so do a trim do a split take element zero and two semicolons just for safety I want to reproduce that this should go pretty quickly I think you may need a third semicolon actually or a semicolon doesn't work put in another one the second semicolon needs a third one to I can't say why or when I did that all right this is going to be a new look up video all we're going to do is pass it a video ID and get some metadata back about it so um categories this is a good time to start thinking about how we want to structure our menus and if I were going to do a lookup video I'd probably go like we need a category for videos a category for playlist a category four um I don't know what else I thought I had some ideas Once Upon a Time but let's start there we can always recategorize later so let's do a new category for video sure well how do you usually do these alphabetic or by popularity video is alphabetically pretty far down so let's leave ourselves some growth room category created action created did I get that in the wrong scope no good it defaults to the current scope oh wait yeah yeah okay good I get nervous when I create things in the wrong scope and we need a like I said this should go pretty quickly because oh data panel is too big where's my create input I don't get caught by that too often we'll call this video ID video ID sounds good it will be a string and it better be mandatory or you're not going to be doing much looking up today and like Mr Andrew Barnes let's return let's do our outputs as well um now I on the other hand I don't know how I got here outputs thank you um I already turn an object which is going to be interesting because um we should have a standardized object that we're using which means we could do a template what kind of things do you usually look for when you get video information I'm sorry what what was that Chuck I'm looking at the return values that I want to send out of this action and it's going to be the metadata about the video so my object my video is going to be an object what kind of things do you usually look for when you're why didn't that stick what sort of metadata do you look for when you're getting a video from YouTube why is that not creating the action output of type object video video object do we have an issue here people I think I might be able to hear you now yeah okay I was having trouble hearing you when you get a video from YouTube what sort of metadata are you looking for as the output title description the consumption from that um the the biggest thing normally is uh the video ID and the description and when it was published when it was like the three three really important ones I I go a little further than that at least I did on the karaoke app and I looked for the duration to see how long it is where it's allowed and where it's blocked because there are Regional settings I don't know if we care about those here but they do come in handy later when somebody says hey I'd like to watch your video and oh yeah I've never I've never consumed that uh so there's also um Channel information so that we can hook it hook it up to a parent Channel by ID and title so we may want that as well I find that very handy because Channel and video are often we may we may be tracking an artifact that's actually published to somebody else's Channel yeah that that would be uh ID appropriate ring um there's that magic plus down here we can just add a few more so the last thing that I get um and I have a separate action for it is uh the St the The View stats but I I do that as a separate there's a separate call or do you want that as part of the metadata uh it could be part of this metadata but I currently uh that is like its own individual call is just getting a video's stats and that's all it does it's a very targeted um thing right now but this could abstract that and make it one call One Call okay let's do title title description description um I'm gonna put a loud in here just so we have it locked locked that could go into Regional settings object of its own but let's keep it simple for now channel channel actually you said um stats let's do stats first stats are statistics how would you like that uh stats stats works for me since it's an object and what kind of things do we have in there uh the view cubes you is it views I think it's fuse and then um it's going to be an integer right and then the thumbs up thumbs Downs um and then the last thing is number of con comments but that's like an entirely separate query from the video really is getting comments for a video I think is its own comments should be its own separate thing yeah that should be its own interaction okay integer integer for likes come on where's my magic plus there it is hey thanks that's a weird place for that this bikes yes bikes will also be an integer and okay comments so those three view count likes and dislikes and let me typos because this is going to be a template later that should be it create another object there there Channel info and there's going to be an object as well we really just need from the Chanel ID and the title okay we have a nice video object to return save that we have our inputs we have our outputs and I'm really hoping we can use the Json parser here [Laughter] we don't know yet I want to that would be handy right it really would it really would so first I want to clean this up I want to sanitize my input with a script so my input is going to be um video ID let's call that video um value is going to be from the inputs video ID works for me and we'll just say outputs dot video ID equals better not forget to create an output video ID video ID is a string as well inputs.videoid dot trim make sure it doesn't have any garbage on it split in case somebody decided to pass in more than one yeah I maybe I lost a little of the context earlier how is this different than the existing lookup video action I will show you that's where it comes in right here the existing video action uses a connection Alias that assumes you have oauth authentication everything that's out of the box is based on oauth um and I I like I said I'm a firm believer that a system to system connection like servicenow to YouTube if you've got an API key use it so why didn't you just start from copying that one and then changing the credential type and connection I don't believe I have that one loaded on this one ah well that's a really good reason why you didn't copy it then I didn't it never loaded from the store and the reason I asked that is because it you know I was looking I just pulled it up and I was looking at the output variables and I was like oh okay title video ID channel ID channel title publish time view count like count dislike count comment count duration although the duration I'm not sure what it comes back as I am going to operate that into a Glide date time goes back as an object currently it's an object with days hours minutes and seconds that feels a bit unusable because you're still going to need to convert it to something that you can use in a record somewhere because it comes back from YouTube as an ISO date yeah I think I would have about 200 formats the one that I see most commonly out of YouTube it says PT 314 you're like okay that's number of seconds fat load of good that does me Okay cool so I'm I mean we can always tweak this later but the resource path is videos it is a get um and here is where the query parameters come in because the one that I absolutely love is from the rest credential value there's my API key and I it it for me it's way easier to set up a rest an API key credential than it is oauth we all know how much we love oauth okay ID is going to be my video ID input or the script step output work and our favorite part the part you remember all about these and we want snippet and content details because content details contains if I remember right the likes and the dislikes and oh no statistics is also in there because we want the likes and dislikes so statistics yep I think that's it oh we also don't forget your applicator your um accept what do you want back I've seen apis fail on this it ain't fun kids I don't think we have anything on retry anything else ID what and part you uh get back the ID as well from the snippet um yeah if you want to break it out from there um yeah I mean it's right at the top level it's like item dot ID okay all right now here's where let's just do a quick test we should see the response a load before we parse it oh I need a video ID darn it YouTube uh uh we'll do something from this community I guess let's go get this one for just one more minute yeah one more minute Arizona phone number I don't recognize the phone the phone went off uh where was I flow designer test I'm kind of getting behind your idea of a default value phenomenal paste that over in vs code on another screen so I can run and get it processing processing processing action no pink let's see what do we get what do we get where's our response payload a response body response body method failed 400. that's not good um unknown part content details oh don't make me go to the videos is it videos list no it's I don't want a list slash videos heart content details statistics snippet what do they what did I type wrong and what part didn't it like it didn't tell me what part it didn't like close that down for a second snip it content details oh I got a dot in there can I blame that on the font save always fast run I want minor success here this is how they get built we haven't even got to the fun of a data stream yet ah oh well no that's my object has absolutely nothing in it because I didn't parse anything yet but down here oh nothing nothing in the items that's interesting okay let's do it this way then over here in our test bench snippet content details and yeah so like that almost statistics ID boom run yeah fine I'll play along and that worked fine ah the fun of rest apis is that not what I said get rid of that we don't need you anymore I can flow designer what did I send name key value attributes thank goodness the key is masked snippet content details statistics ID value nothing what did I not get a value out of that well it's not going to return me anything if I don't have anything what was the output of the script step had no output okay you know what did you not to set the no you've got a [Laughter] oh I can't edit that thing what the heck okay fine you know what I'll do to you I'm gonna delete delete them edit when in doubt take it out video ID string just just a note there um particular here I think you're fine but be careful when you're killing an output variable and putting it back make sure you save uh between those actions um especially if you're trying to overwrite a name the label is fine but if you're trying to override a name that one appears to have worked safe run one more time and and we have nothing oh because I still haven't parsed it yet right where okay um oh oh look at that nothing what in the world uh okay that doesn't look like a very good value or is it supposed to and it's still called vidi all right let's take your to that your your suggestion delete save create Save Right yes sir I I get a little nervous with the uh that's grip status outputs script output looks fine to me you know what I'm gonna do a whole page Refresh on this just to see what it thinks it's thinking and e okay I'm missing something fine we'll do it again delete save wholly unnecessary but okay what here just to make sure I'm not going to fat finger this ER and Save no I lost my copy paste buffer with the ID go get that test test paste test I just want to see the output of that script step it's driving me nuts what is it about this show that always trips us up on the simple things okay step out there we go runtime value yeah yeah we got a runtime value there and oops that's not what I was looking for I want the that's looking better okay we have a payload that's step one get data okay now I think when I originally wrote this it was pre-paris and I didn't have a Json parser so oh please let us do this actually I kind of wanted that uh output didn't I paste it in here you can still go get it that's true it's in the execution details executions from right there yeah fair enough oh not there it's in the steps okay so we want the response body take that I didn't check do we have likes and dislikes we do you count 71 like one comment count one looks good to me we got everything we wanted out of that payload and just dump it in here no yeah dump it in here Target Target something about on blur on Focus whatever okay so we why did my Json parser step up here I just wanted to go where it wanted I can't move it that blows watch where you're stepping kids Jason parser go do that click generate root blah blah blah good okay now uh to map this to our object now puts here wasn't there like a save template thing somewhere when you're defining the object and outputs I thought there was like a save as template where was that I always seem to find it when I'm not looking for it and I've had varied success with this what are you looking for save this template so I can take this definition this object definition I don't remember where that is it's probably it I'm not dealing outputs and maybe after you save it well I did Define it and I did save it a number of times this this hasn't changed in the last several saves edit outputs roster here it was under here he is okay so save as template we're going to call this uh video Maybe save that because what I did in the karaoke app was before we had a Json parser I just called another script step that did the mapping for me in a script include and that was all nice and everything but now I want this is going to give me an object with this Rudy root stuff all right but I want to dig out the necessary pieces from here into my object I'm trying to think what I need now it's not a script how can we so I think um let's just take a second and remind everybody what we're doing so we're working in flow designer uh working on a new action uh so it's in the integration of Hub action um to leverage um the lookup video feature and there's an out of the box book that does this but that is using oauth and Chuck's application needs to use the application um the API key the API key and so we're sort of doing some replication from that but effectively we're rebuilding that look up video to use a different authentication profile and it's a good exercise of the steps you need to take to build a rest API yeah so given that we've got our payload here but I want to map them to my output object so we've got one object here we've got one object here how do we get pieces out of one into another can we do that in a drag and drop or do we have to script that nonsense I don't think we have a step that says create object um a load Builder entered a flat Json or XML mail log SMS parser Powershell soap so what what are you looking for I'm I'm looking for a way to take the output of this Json parser which is going to be a lovely structure of exactly what YouTube gave me back yeah you know with my array of items and blah blah blah because my channel information is in here somewhere my ID and title and everything is in here somewhere and I want to map it onto this structure the simplified version the simplified version I mean the other one you just click and pull the data bills across so yes you can you can click and pull the data posts another option the other option is to see what happens when you drop that object in the top level object and see what populates but you might need to create a new output object drop the Json object into there and then remove the parts from that created object that you don't want would there be any harm in just returning this entire Json object to the flow or subflow and just say here you deal with it well yes there is because we don't have the dates and times the way we want them right um so when you go into content details and you look at like duration it's it's going to give us one of those crazy formats which is why I think I did it in script last time boogers okay here's what I'm gonna do this isn't my favorite way to do it but I'm going to do it anyway I'm going to create a new script include if we haven't already built one similar to this for my YouTube utilities this is where things like date conversion go and plural or singular that's interesting it has X underscore brand nice scope name you're welcome all right and I am going to wholeheartedly if copy paste works on this field rip this off and put it right in here ah it worked okay so things like this that we've we've done a hundred times before if I pass you a URL from YouTube You're Going to parse out an ID from it if I give you one of those Z times you're going to give me back a Glide daytime or other way around just those handy little things this is one another one of those crazy I call it P times the P2 seconds PT to seconds um get ID list from HTML this worked for an email import like if somebody forwards me an email I can get an array of IDs out of there I don't know if we'll be using that in this particular instance but here's my object maker right pass in one of these crazy items item.id item dot snippet and I put it into my object with converted duration and I also this is this is your friend kids don't assume your object always has like the objects within it use has own property before you start accessing things so you don't get null pointer exceptions and undefines all over the place say only go to this part if you can go to that part and that is that but I want to you know what I think I use the duration conversion as a separate action I'm pretty sure I did well that's no fun okay we had Channel we also had an object in here for I'm just going to do it this way for now um stats which came from item dot something dot something dot something we got a colon in here you can do it this way but you might you may not want to you know what given our discussion about just dragging data pills that seems like an easier way to do this doesn't it uh we you know it depends on you know if you're doing the data conversion or not but I'm not in this particular and in this case if you're not doing that then then it's not either data bills okay but I'm still going to save that because I do have functions in that I want to use later well let's go back to flow uh let's get our ID oink we're not on why isn't it lit up uh because that is a array of objects okay oh and this is not and I'll bet my scripted Sub-Zero on it Sub-Zero they make very expensive commercial refrigeration systems sorry that was just from another lifetime um I pass in an item so I would be passing an item Sub Zero which isn't going to work here um which is probably why I did it in a script step before Json parser really didn't buy us much earn it although no we could we could because we still have access to that let's do this this is feeling a little bit over redundant but my input is going to be an item okay take the item and yeah we gotta take the item items and dump out an item yep I think so items value is going to be root items everything we need is in that first element and then we are going to do a linear output yeah did we create a template I don't remember if we did or not shoot I recall you creating it Tim well I recall you're showing the button save his template in the bottom right yep same as template and we called it video yeah okay so we should have that right so our output here should be um we could call it video we could call it item we could call it whatever we want and yeah you need the from the drop down object yeah you need the drop down sir right drop down from start from template start from template that one spoke video okay felt easy let's see if it was easy so what I need to do in here is run my little scripty script I gotta finish filling out the part that I started in and aborted oh it's gonna be close on time to see if we've got this um outputs dot video equals new it util make object from inputs. items Sub Zero Maybe sure that feels good uh yeah all right yeah right and my input comes from we already did that the items that looks good let's go finish the script save that finish doing to the script that we started doing to the script this is going to be stats these type keyboard thank you is going to be couldn't you just what do do we need this or do we can we just uh do stats like item.stats um what I was thinking Chuck is instead of passing it to your script include can't we just return the singular item object uh yeah yeah that would be a cleaner meeting instead of the script include yeah because the script includes just doing that mapping for us of that one so this could be like this yeah I like simple is good but that's not going to map to this object this has a different structure wow yeah okay I think wait hang on hang on does it well ID pull out your data panel and look at the side yeah um no because allowed and blocked were under the regional settings they were buried which is why I had all that has property stuff in the script um okay all right good thought I liked it can I do an undo noise all right attempt number three [Laughter] they I mean it's nice telling us that there's an error in that script if you could be a little more specific on what the error is did I have an error what do you mean so they said there's a typo tell me where the typo is I don't know where it is it was above Ventra outputs oh did I oh you lost the T in the output did I output I did thank you extra set of eyes on the internet okay stats those are the kinds of things that will slow you down where's my output variable values see this is an object no one who have likes links darn motor skills is going to be item dot statistics dot I don't remember this is where you keep this window handy and you do a pop out on this window if I remember right show code here we go statistics had view count like count and dislike account you know what let's just copy that so lights was going to be like count like yeah like dislikes is for dot statistics on the heck with that real get that too all right and make sure we don't over subscribe that was a singular or plural I think it was singular yes yes okay and view count was views for my world views come on I did not hit enter twice I promise this should be view count and put a comma there to keep Json world Happy do we have anything else in that object that we needed knee Channel stats no I think we're good okay looks pretty good it's pretty good save that Let's test it oh man I'm I am not super confident but give me a can I have a test button oh I do have a test button I was looking for the save button and I need my ID my test ID back on that where do we get the data streams kids oh look we're almost out of time [Laughter] uh uh Json data how far did we get step one step two step three we know that the rest step at a response body you know what we parsed that oh you didn't link up the data the payload in the Json parser you are correct I knew something on an input didn't feel right so Json first step in the source statement we actually need to give it the source from the response body is that where we're going uh yeah it should be the response body yeah we should be I should be I love that we're going to have T-shirts live cutting happy hour it should work paste run if I have three or four Fields yeah default values or the win invalid return type complex object this might be where I had issues with templates okay this got that Json parser what did Json parser give me root items items from zero is this lovely object and the script step content details is an array of nothing that's weird I think it's the way that we're accessing these things what's going on the scripts that got in where did I pass the script step I thought it was an object it doesn't matter it's not you don't Define a data type there it doesn't like being passed oh you're you were passing it in items and maybe you need the can't pass it one what was your what was your script step expecting was it the higher level object no it was it was a piece of that and I think I think you're right I think I've run into this before where you have to pass at the top level you can't drill in and give it something in the middle yeah so let's try that of that pass it woot and this becomes is it root dot items yeah I guess or does it have a name is it just no let's not call that we're just going to call it root which kind of bothers me from a variable name root dot items Sub-Zero say maybe I want some success out of this before we get two minutes left I don't want to be the uh the goat here we go run run run run just long enough to make you nervous probably gonna say at this this is where I go your API key limit has been exceeded oh and that find function make object really did it come down to me just not knowing my own script include make object curses hate it when I do that foreign make object boo yeah I didn't say I was the best person at naming variables and function names there we go test paste run wait wait some more take a drink a drink consumed on a hit run test [Laughter] I'm so excited I hit it again wait some more take some more drinking hmm it doesn't know what that is what did they pass it okay it's all about the objects isn't it kids it's a comment that says our input variables are wrong the input variables are wrong really we lost the input variables dot root root oh yeah what happened there Json oops Json parser root save watch it wait for it okay test paste run uh let's make object the Right video ID only use one no errors and we have a video object output that has nothing in it we've seen that before I think the video ID was off right or no the output of the script step is empty input to the script step is where here nothing okay makes absolutely no sense I think when you ran your test you had make object in your scratch Pad instead of the actual video ID that you're testing against did I don't think so like run your run the test again oh hey yeah stupid copy paste buffer it starts with an M it's about the same length you know what that's what my eyes saw I was like [Laughter] it's like that's not a valid ID hey no errors loud block Channel ID no that's still empty as anything I'm not gonna get there what's my script step doing it's taking it's got a decent input yeah this is object dot item subzero should be a bunch of cool stuff all right it's going to come down to what's the script include doing at this point I can debug that we're close we got stuff and and I want to know if the templates work because I had mixed success with templates before all right we are at the top of the hour plus a little bit I know the show I think it's a relatively good yep uh wrapping up time [Music] we got something done should have worked on the todoist integration so yeah that was a lot of fun I always got some good work done uh we're I'm ready to deploy some like it's committed some of that work is now committed and ready to deploy production which is finally which is the best which is the best state yeah is it's been peer-reviewed and it's ready to deploy the perform layouts if it doesn't work we're gonna blame the YouTube comments absolutely thank you so uh just quick wrap up then um I think we covered most of the news earlier at the top of the uh show um but real quick come join us Creator con um we will have the link in the description uh but come join us for creativecon um uh Chuck Brad and I will be uh all around in the creative ground space so we will not be hard to find us there and engage with us and we'd love to chat with you uh during that event um and uh you know get engagement there because there's good content to learn from there and um for the rest of this month uh contribute to hacktoberfest uh because it's an awesome time um I've really enjoyed uh both contributing and uh being a maintainer for some of the repos and seeing uh the issues come in and then other people picking up the issues and solving them which is great like I love that right because you have an idea and you have someone fulfilling an idea um and those don't have to be the same person uh which is which is a lot of fun um so a lot a lot of good times um uh you know I think all of our beverages were high quality and uh anything that you want to close us out with Brad why don't you wrap us up yeah I think uh I'm I'm good uh this is fun good good four hours first thing in the morning uh doing some live coding uh but uh yeah we'll see everybody in a couple of weeks at uh Creator con and I guess next week is when all the content goes live yes the 20th next Monday or is that a Tuesday the 20th okay no Tuesday Tuesday is the 20th Tuesday's the 20th all right yeah so look for all the all the content going life and I got my my Creator con shirt on I'm ready to go let's do it this is the mission to Mars one I'll have to go get my Creator con drinking glass all right well have a great day everybody thanks for joining us thanks everybody thanks everybody

View original source

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