logo

NJP

Impromptu Coding - ServiceNow ADS-B Integration

Import · Mar 06, 2020 · video

what's up everybody good evening I'm mark Scott I am your host and today we're gonna be doing something a little different than then we've normally done on the past you know mmm I've gotten enamored with it's called software-defined radios and one of the things that I've done is I have started kind of monitoring air traffic that's kind of it's gone over my house and I'm in a very unique situation right where I get to see a lot of this awesome stuff and I'll show you guys here in a second here and switch back to my um my view here but so let's let's let's start at the beginning I saw a project one of the other architects at TBC had done to monitor the air traffic that was going over his house and he was using something that's called a software-defined radio what is a software-defined radio you might ask so I got I went out and bought this very very very cheap back in the day suffer define radios were very very expensive they've come down a heck of a lot now in price so that almost anybody can can afford them I mean I mean you know the price point here is $23 it's it's not bad and if you want to get a full-blown setup going with you know an antenna and everything it's actually a lot cheaper you can do it with twenty nine dollars but basically what this little device does is a little little USB device here and you can see that the USB dongle on the back and this allows a computer to hone in on radio broadcast frequencies that you may not know actually exist so anything from radio towers cell towers anyone using walkie talk aircraft aircraft control tower communications the really the sky's the limit on this thing and what's really cool is that this this SDR the software-defined radio has a huge range right so 25 megahertz to 1700 megahertz that is a huge amount of bandwidth there and the best part is that the the the you get to then use software to define exactly what range you want to be looking at and and that's that's really cool so for example if you think about your car and the FM radio in your car what it is in that little dial that kind of well we don't have much today I don't really have dials anymore but the buttons that allow you to change the the station and really all that's doing is it's just changing the band the frequency band that you're actually listening to so for example here in Arizona we have 9033 which is a an alternative rock station well 1933 is on the nine 393 megahertz band and I'm probably wrong on that but it there's a baton 93.3 megahertz band and when you dial into that you obviously get music well modern day now when we don't just type in music we actually pipe out a lot of things so you know the title of the track that's playing the the artist some information about the radio station things like that all of which is accessible if you just know how to tune it well this little device here allows you to tune into radio frequency signals and that's what makes this really really cool well one of the cool things that you can do if you've got one of these little devices is you can actually tune into something that is called a D s dash B that is automatic dependent surveillance - be broadcast and every airplane now as of January 1 must have an ad s dash B transceiver or a transmitter the transmitter just out pulses a bunch of really cold data well why is that important well mm-hmm well I actually live in a very interesting area and especially if you're in the East Valley of Arizona Phoenix specifically you we have a lot of really interestingly placed airports so I'll show you guys so I'm sandwiched in the middle here this right here is Phoenix Sky Harbor that's an international airport that every you know most people that are coming into the Phoenix area come in and out of there's a Phoenix Mesa Gateway Airport that's down here there's a Municipal Airport and channel Municipal Airport that's down here and we also have Falcon field that's up here so I've got a lot of aircraft that fly overhead specifically to I'll zoom in on this one this is a level one trauma center so they actually have a couple of different helicopter pads they have all sorts of stuff here so there's constantly airplanes and helicopters that are going overhead of my my house on top of over here is another in this area over here is another level one trauma center so I can't I get tons of aircraft flyovers all the time which is really cool so why not use my software-defined radio and my aircraft overhead ability that we tend to get all the time and start reading some of the information that's being broadcasted outside of this ABS - beam and that's what we're gonna work on today and specifically we're gonna pipe it into service now the reason we want to pipe it into service now is for persistence right so if I see something that's really really cool or if something really really cool pipe flies over my head I want to be able to save that and see that and I don't necessarily need to be home to see that so what I have is this little antenna here and this little antenna is just plugged into that USB stick and that USB stick is then plugged into my computer and when you put all the pieces together well almost drop my antenna when you put all the pieces together and load a couple of different drivers in that you can find some tutorials online I'm not an expert in that but once you do you get this and what we're looking at here is the flights that my little antenna connected to my USB dongle can actually see this is in real time so right now there are flights going overhead or there is something at least within the the range of my antenna that I can see so let's pick one so let's do this 1 SW 8 9 8 7 so SW 8 9 8 7 is a Southwest Airlines flight so type this in to FlightAware SW 8 7 and what we should get ok so interesting all right so here's a plane that is about to land in Phoenix you can see the you can see the map here so I'll zoom in on the hub so you can see there's a plane headed in right here into Phoenix Sky Harbor Airport and it is within range of my antenna so we're actually getting this information near-real-time out of this radio which is really cool so I can actually track these flights that are coming in and out and I would love to be able to push that into ServiceNow well one of the things that I found was messing around with this now this is a this is a program called 1090 dump 1090 dump and why is it called 1090 dump well a DSB runs on the 1090 and megahertz frequency so yes I can see maybe it's not 1090 maybe I'm wrong yeah all right good ten nine you don't yeah eighty eighty s ten eighty dump all right so dump ten ninety is the program that I'm running and dump ten ninety just allows the bytes and bits that are coming into that antenna to be interpreted correctly and categorized with what exactly is being shown on the screen here pretty cool and we get a bunch of really cool data here so the latitude and longitude obviously of where that airplane is speed heading altitude the flight number and then squawk which is how you would communicate with that that plane if you were to call them over the radio in my testing of this what was really cool is ten ninety dump allows you to run a web server so that you can see all the stuff that's happening in real time so instead of me copying and pasting or writing it manually into flight aware I could go to this website and I can I can just look at what is is output here well unfortunately there's a bug and I can't get this to load and so I started taking in here probably more than I should have looking at these JavaScript errors and while I was looking at that I noticed something really really cool so there's this initialize function here and that initialize function actually calls out to another JavaScript another JavaScript file here that I just don't seem to have access to I'm not sure exactly where it is but within that javascript file there's an actual get there's a JSON yet that's being done and from there which I just happened to stumble upon I actually figured out that I can do this so localhost 8080 8080 is our port and localhost obviously is just home dump 1090 is the software that were running and then data JSON and if I hit the run on this look at that there's all my there's all my information so the goal for tonight is to be able to do a JSON or do a rest message inside of ServiceNow into a localhost into my local host here and then pull that data back now my my goal with this and my guess on this is that I'd probably need obviously need to run a mid server if you're not familiar with ServiceNow mid servers they've just a Java package that runs inside of your firewall and it's really important because I don't necessarily oh boy that came out of nowhere okay I don't necessarily want to expose all of this data out beyond my firewall right and especially this computer it's not a hardened computer this is my this is my desktop computer I use this for streaming I don't want this guy running mcc's paws to the Internet so I will install a mid server on this guy and from there I'll be able to pull with the rest messages I should be able to pull localhost on 8080 I should just pull this in and then on a import set and on a schedule I should be able to just yank all that into ServiceNow and then dump it into a table so without further ado let's get started I'll switch my view here so we're gonna go back to the let's go back to my dev instance the ServiceNow good old dev 88 for 93 log in here hey there we go okay that took a hot second but that's fine all right so step one we need to install our mid server so again this is just the package that's gonna be running locally on this machine so I'm not too worried about get this installed it should be pretty quick okay now I'm gonna I'm gonna commit a little bit of ass in here I'm just gonna throw this package anywhere really I really don't care where it's running and and I'm probably gonna make this a very immutable mid server like I'll just kill it later once I'm done but you know maybe I'll I should probably put it in the right directory just so that I don't have to worry about it but one of the things that we've I've learned with installing mid servers from my good friend John Diaz is that you really need to put them as close to route as possible because there is a file limitation the file name limitation on the mid servers so as close to sea as possible if you're running on if you're running on Windows obviously Linux isn't gonna have that that bit of a problem but you can get in yourself into some problems with credentials discovery if you don't have this package set up properly if the end goal is to make sure that it doesn't get so long and you can see these these names get very long here so if I was to extract this that you know the name gets very long you don't really need that so what we like to do is set it up like this so and our C Drive here folder mid server and then we'd like to sub this out - which instance we're gonna be running so this is my dev eight eight four nine three instance so I know exactly which one is running in case I'm running multiple alright cool so now that I've got that setup I can do my download come on in here just copy this file out cool beans alright throw that in here alright well that's going actually I bought myself a stream deck to help with my streams and it's been fun setting that thing up so I've actually got a couple of little things loaded in here so we'll hit the button this will be the first time that I'm able to hit this button and I'll actually work so I said the word cool which kind of set me off so let's see if it works it did work that's awesome so I got a couple of other things let's let's see I'm I'm your typical developer I try to clean it up for this stream but every once in a while I tend to say the wrong words so here we go for the oh it didn't work but what's cool is now that I realized that it's not working I can launch my boys on there we go alright that's good voice mode you go in here I need to add voice mode to my button list here so I've got I can actually like click a button and have it like open visual studio code so you'll see it open up here in a second it's taking its time maybe that didn't work I don't know up there it is all right so I can just you're just one button push pushing open a problem a program and then I've also got a couple of audio things here so here's here's the bleep now oh because it didn't work all right there you go close it now it's open maybe you guys can hear it but I can that's weird okay try it one more time there it is look at that now I can say all the dirty words I want I've got a couple other things that are annoying in here like let's do the the wrap trap horn I could be my own hog man I love it and then of course when I realized that something is not working record scratch so all right so that finished let's go through the install process here now obviously I need to do something I need to create a user account so user create a new user account so again this is something that you'll have to do for every ServiceNow instance when you're setting up a mid server right if you don't have a user ID you'll have to create one so do server a good password my auto-create I have this weird thing in chrome where it auto fills everything which is not cool a special energy server or I'm sorry I'm great users and things like that like mid server users so now that we have the server user will have to give it the mid server role all you have to do roles edit and my pre-fill is messing with me I made server yay ok Sam sweet sweet sweet ok in context I love it ok now we can go back so here's our agent and still got that run [Music] eight four nine three will it work it has an air doubt by now it's probably gonna work make sure all right there we go all right cool now I know next and we're gonna go this is a desktop mid server the irony is not lost on me there I'm okay with that rapper name and that's okay alright next and next so we're going to start the mid server and we're done so exit and let's go double check that our mid server is online I might take it a minute to come in here nobody installed correctly it's weird I've seen this happened before on Windows 10 it just does not want to it does not want to play nice Oh what up James let's start in how's it going in this is the part that I get stuck on I'm gonna be so so mad so mad yeah buddy you know it yeah so let me just show you where I'm at right now so I actually have it tracking in here in my CLI all I need to do is install a mid server and have the mid server pole this guy right here and we should be good to go I know right yeah it's it's a little yeah that's cool I know right like it's it's insane you'd be surprised what's out there right so I've been I've been tooling around with this for quite a bit just just listening to different frequencies just you know listen to other people talk about is it tripling messages on the thread now I don't see a trip [Music] well that might be no BS I'm not sure I'm not sure huh take a look at that I'm not sure check that's alright we'll figure it out later actually let's go let me just double check restream real fast uno momento por favor let's see alright it hit it Jase let's see what happens here No No there we go I didn't think you meant to say that the first time I'm not seeing any tripling that's weird you have to send me a screen cap and let me know all right if this if this does not load and I'm gonna be so upset damn have any servers in here this is not gonna be awesome if I can't get this turn it's on the stream weird weird weird oh oh oh I see what you're saying I get you I get you I get you why that's so weird you know what it is I know exactly what it is let me let me do this real fast in in slobs if I don't actually re restart it here to refresh the is refresh the widget real fast and then it should be good to go I think I've had this on and like kind of messing with I I think I've had it open a few different ways or maybe I've got it even open twice or refresh cache yeah I get what you're saying yeah it'll be in the video I know oh we fixed it look at that working together to solve problems it looks good to me I'm good I'm good with that yeah I know I know I know you're just helping me out all right so I don't understand what's going on with this mid server do do let's I think I might actually need to run as admin this is this is one of those things you end up having to debug or this is let's see if it's running then who it's running as see I tried I tried to work out most of the kinks for this dream I wanted to make sure that it wasn't it wasn't just me screwing around here and and and not getting anything done so yeah it's just weird it's just weird I'm not sure why it's not running but we'll figure it out okay maybe it's not running yeah so the data that it pulls back is it's going to be it's going to be the flight number which is really the tail number here altitude speed heading latitude longitude I would imagine sig is the signal strength and the messages is the number of messages time is the last time that it actually saw it so for example you can see how this one's ticking down we haven't seen this o X F it doesn't like that we haven't seen this one for a little bit so it may have taken off and it may have gone somewhere actually that's a really cool tail number in 1c and now it's gone damn oh that's ok now some of these okay so this is this has to be a something I'm pretty sure this is a helicopter no it's a single-engine plane so it's just a it just looked cool the tail never looked cool but I also get somebody doing laps getting their their flight hours in okay so let's switch back to debugging our mid server here it was really gonna put a damper and things if I can get this mid server running I'm gonna be it's a serious sticking point okay let's see if it's oh yeah I know it just may be one of those things I don't know that everybody wants to watch me struggle through this on a live stream you know I swear it was I don't see it running so one of the things that you should see it running is a service here and I just don't see that happening yeah I don't I don't see anything running let's yeah let's check agents dot log and just double check I really didn't want to jump into that but if I have to we can yeah it's it's it sucks like I hate having to open that damn thing up all the time and just see if it's running because it's supposed to be headless right it's not supposed to be something that you've got to open a whole bunch let's see what the instance dududu connected let's go back can I run the installer again yeah yeah it's a pain in the ass and especially if you're on that that many for you know 30 that's well I mean it is based on Java so Java tends to leak memory like it's a colander see everything works so actually let's close this put the Installer let's run this as admin and just double check that we're not in operations issue here really you don't need to run as admin in Orlando okay okay this is me testing Orlando view yeah I didn't mean to do that I don't want to test features I want to build cool stuff I would you know and I think that there are probably people on this planet that would kill to read your notes Jase I mean it's it's it's like that scene from the waterboy with a little the little green book or whatever like people people are going to you know just want all the stuff that you build man I am not seeing the surface run this is really really making me angry process and it's like it's just starting up and then dying Chavez running okay what was that called pretzel salt helper that's awesome it's required your great your mid sir discovery let's see won't you send me Jase require personal finance there's no one here you know it's funny because if you put it on if you put it where I put it because I put it just on si mid server this I'm wondering if there's a permissions issue with that but I've had this issue before when running on it on Windows 10 that you're gonna make me do this aren't you alright I almost wrote LS LS is the UNIX command oh dude don't I I don't know what you you don't make me do anything I know but you're making me you're making me want to do it now this is awesome - drew - drew starts out bad you should just start that isn't what I thought it was really not in the right okay yeah we can do it what that's an interesting error message yeah I gotta go look at this oh there's your logic there it is Jase look at that if service external I bet this isn't installed as a service that's really gonna make me angry yeah it looks like it's good because you can see the air level here and then it tries to check admin but I don't think a act as you can see here's the logic where it's like oh go try this I don't know what this is doing because I'm not I'm not a batch batch expert here but um if admin take its new key wrappers used to admin go to you okay let's go see if we can force it open from the bin kill that yes yes look at that things are starting yeah why I had to do that I'll have no I have no idea it's service okay so now we should have the service running see if we can find it in there there it is okay well I don't know why for the life of me that start dot bat did not work but when I manually added the the mid dot bat start with bin with it from the bin here everything just worked just fine so hopefully and come in here oh look at that okay we're making progress now that's obviously not something that we're gonna want to do long term right that's gonna every time I restart this machine then the mid servers are not going to start up but obviously it's something that we'll have to have to fix but I'm not super super worried about it all right validate our mid servers so that we can start doing some cool stuff on here I'll take a few minutes I'm not sure how I'm sure why it takes that long but hey yeah hey I lose so the other thing I gotta start doing is Jase I was I was talking about this earlier but oh because it's validating oh hey yeah no problem no problem yeah I love I love I love having questions so you know pop it up pop up if you've got a question if something doesn't make sense but I'll just give you guys a quick recap of what we're doing here so what I've got is I've got this little software-defined radio here this this new electric and it is a super cheap software-defined radio in a software-defined radio is just a like a USB dongle that allows my computer to tune in to certain radio frequencies and if I know what I should be expecting on the other side I can do certain things with it so if I know that I've tuned to an FM radio station I should play music and pipe that through the headphones if I'm connected to some sort of data then that data should be displayed somewhere well what we're trying to do right now because I live in between about five major airports or well I live in between a bunch of different airports and about a level one trauma center with like helicopters going over my house all the time so I live in this very unique area where I get to read I'm very close to aircraft well what what this this little stick allows me to do is read in the tail number altitude and things like that using this a d s dash B is automatic dependent surveillance surveillance broadcast and every every airplane now in the United States it's supposed to have this so as long as I'm listening theoretically I should be able to see all of the air traffic that's coming over my head we've installed the we've installed the dongle we have set up I've got a little antenna that's sitting next to my desk here and I'm actually pulling all that information using a out-of-the-box package that somebody else has written so we can see here these are all the flights and the tail numbers there's some altitude reading some speed some heading latitude longitude and then the signal strength obviously which is funny because this one right here that's pretty dang strong wonder where this guy is ah so given that I have a flight number so G AJ 8 3 2 so I can just pop this guy gaj 8 3 2 hit enter so you can see that there is a plane here this is this would be just about my general vicinity over my state they're obviously flying over a head but they are not they they're not stopping here so you can see it doesn't matter is that there they don't have to be stopping at the airport they just have to be flying overhead at some point and that's that that's what we've captured here so yes yes so you can literally just build that map out and that's what a lot of these things do is they have this mapping interface and you just build a little map what's really neat and and something that I didn't I was just absolutely flabbergasted that it worked was if you have an OTG cable so OTG I don't know what that EG cable it basically just gives you a little USB dongle on the side of your phone I can plug this dongle in to that dongle on my phone and run an Android app that actually Maps everything and just shows all the aircraft positioning on the map which is really really cool but for the purposes of this we want to do we want to do this into the mid server so I'm pretty sure my mid server we want to throw it into service now so we're gonna obviously do that through the mid service so I'm pretty sure that my mid server has finished validating which it has just reload the form and double check that it is online it is online all right now now we get to go to some servicenow kung-fu here so rest message so let's create a name rest message and we're not gonna put that I guess I should put it in an update say now shouldn't I let's create a new update set which I don't have all the awesome stuff that I normally have I need to load explore toolkit and all that in under this instance I just haven't done it update sets if I could spell all right so let's create a new update set so that if anybody was ever interested in doing any of the stuff that we wanted sorry so we'll hit new oh yeah you're right scope tap is not a bad idea on this let's just go tap let's do a scoped out why not let's do a scoped out so I'll build a new scope tap in here create application and what should we call it ABS - B playground I don't know yeah yeah then yeah it makes cleanup so much easier I'm totally on board with that and I think my original intent I originally thought about doing this as a scope that but we're just gonna call it ABS - B because why make it complicated - juice stores stores data from 80s be suffered to find radio man that's good I like acronyms like that so we're gonna hit create I don't know that I want to build any roles onto this will just say continue on this do the seniors for listener performance we're yeah we're just gonna do classic I don't want to deal with this I want to deal with learning stuff too much stuff at the same time so we'll obviously need a table for things I'm not getting any there we go so we'll create a new table great table from scratch now I'm debating that whether I want to extend a CMDB table and put the aircraft in as a CMDB injury or if I just want to create a table from scratch and just yank it in I think for the purposes of this I may just create that table from scratch I guess I don't know that these are great seem to be tables and I don't want to deal with the CMDB overhead as of right now plus if I extend the seem to be table I'm gonna get a bunch of out of the box fields that I just really don't have a whole lot of use for so let's just go ahead and create that table from scratch and we are going to have a lot of fields here so let's go with so I do let's just grab let's grab the flight and that'll be a string therefore you should be good on that exactly exactly if I could spell let's go with should be good I don't think that these I don't think these squawks can be 0 based so I think we're okay so the the problem would be if it started with a 0 I would want to keep that zero that you know that that padding in here but I don't I don't know that any of these numbers start with zero so we should be good to go yeah you think okay so keep it keep it straight for what's one to one on here so let's do that you know what you're right Jase you're right you're right let's do it don't know that I really care about mode but we're gonna pull it in no matter what string and we're just gonna set that to 10 because I know that the modes only gonna be one but yeah it's fine all right I don't feel go which is the altitude and we're gonna go chair yeah I totally agree with you well that's not a journal field I do like this interface though this is this has been so cool we're gonna throw speed in here it's not gonna make a whole lot of sense because this dad is gonna be a you know static but it's fine we're let's let's pull in everything that we can just for just for the purposes of being complete here just I like that I'll do L and G but L Ong scares the heck out of me and why does that scare the heck out of me L Ong is an actual data type so I don't necessarily want to name the field that because that scares me and these two are meta data I'm not sure that I really care about this so we'll keep those out of here so continue what should we call this flights just gonna call it air craft for now like like like Jay says we can always change this so sure we can make it extensible so that nobody has any problems with the right continue all right it's gonna configure the table for us all right continue done with tables because that's the only table you need and we're done all right so let's get this roll in here this stores data about overhead lights yeah and I'm totally fine with that I would rather make it I'd rather make it accessible super accessible so I'm just gonna gab admin in here because I don't really care that's a good point that's a cup of wine that's good point I like that yeah done with apps all right let's call it a day done no sweet all right so now we have our cool little aircraft table in here with all of our I'm sorry so now we have all of our aircraft table with all of our stuff that we can plop in here now what we need to do is create a rest message so rest message do you do we do name hahaha alright how do I plan to populate this this little guy is running so this little console app here when it's running look at that we can see look at how many I've got in here that's awesome so this guy actually runs a pseudo web server on the backend so all I have to do is and I found this on accident all I have to do is hit this button and I get yeah so I'm not exactly sure how that works right now I know that it's streaming things and I'm pretty sure it's just constantly updating this so I think I can just tag it there just hit it a couple of times and get the data that I want to get out of it and we'll just do it on an interval so you know every every five minutes or so I can pull something or every minute or whatever we decide the interval is going to be we can yank that in so 80s be suffered to find radio end point is going to be this end point here which is technically our localhost we'll just leave the scoping alone for right now and submit though just hit save real fast we'll do a default get on that and we should be in like flint here so now authentication type there isn't any authentication type it's just hanging out there in the breeze so let's let's see if we can pull some some data in so we'll hit test on the supported protocol localhost that is totally fine pretty sure I didn't let's it may it's may still not like that and we may have to do one 27.0 to zero that one yep no not yet you're right thank you for catching that I'm pretty sure there we go just top mid there we go okay update now we're cooking with gas okay let's do test hey there we are okay cool cool cool go alright now that I have all of this I should be able to just do an import set so instead of let's I kind of want to use all the out-of-the-box yeah the gifts cool huh that's this is this is my new my new toy so my stream deck is my new toy what I'm thinking is import set web server script or some fighting Wizards interface you import side tables all right sorry Jace I missed that one was oh you can use the new Orlando stuff okay what specifically because I'd love to use the new important port set API is just that you want to throw a link at me is that this is that this import set web service based on the associate transform in Spanish well I feel like that's what we want but I could be wrong on that yeah she did over man when you get it let me know cuz I feel like we're super super close on this you know what let's just I almost say let's just build it it's a script yeah that's what I want I want to be able to pull this script in so you know let's just try it and see what happens we can always always try later just that'll be my target table oh I don't know no I don't want to create a web circles hmm let's see okay I knew I had read this summer you're totally right and that's exactly what I want to do you are 100% correct all right if you've never used a data source inside of service now this is we're just gonna kill that all right this is one of my favorite things inside a ServiceNow data source type haha I love it love it love it love it okay we're gonna yes B no you know I'm gonna call it Dom 1090 JSON because that's what it's called so table name aircraft something like that and I don't know sounds good [Music] I'm just gonna hit seitan this importance that table must be an extension oh yeah let's see it now let's copy for example - okay cool cool yeah oh and you did it with a rest message haha chase you have no idea how much time you saved me on a daily basis like I'm telling you I owe you so much like alright so thank you Jace this will definitely do some awesome stuff so let's since we've already created that rest message I don't want to lose sight of that so we'll kill this we're gonna go into the default cat and we're gonna go preview script usage I know I know I'm the same way so really we should do it within a try-catch here because that's the best way if the message could be between you through these ecq either by setting about senator calling executed one needs to be one needs to set skip sensor to be true otherwise when we get in there yep hey remember doing that so we're gonna skip the sensor because we do not want it to run like a since the ECC he runs discovery we do not there's no sensor probe that we're gonna run so we got to tell it explicitly not to do that so this will be the beginning of this it's safe and again that was just a copypasta that wasn't anything super super intense all right all right Neto I can't deal with this there we go all right that looks prettier actually I hate it because I can't I just I can't look at it when it's all right cool there we go now everything's set and I can actually look at it so okay go back to what you were saying yeah record lows right okay yeah that's fine yeah so let's let's let's put it through its paces here because this will be an actual like data ingest right okay I want to see what you're doing so 4-inch Oh and then you build the map I love it this is so cool okay taking that because I love it okay so for each result which isn't going to be user it's now going to be aircraft weight - easy to read oh okay what is look at that that's so nice I love it and is this just a is this button just loading in and out the CSS J's are you doing some some funkiness on the back end I saw it kind of flash there for a second oh it just it's a theme oh okay yeah whatever you know what why reinvent the wheel if you you know there's no point all right sorry about that guys all right cool let's keep truckin here this weights so fast I'm so so so so surprised all right so let's go back to this I hate that why does it do that all right hex mark that what do you mean copy/paste I don't know that I then just goes blank it just goes blank it's weird yeah it doesn't like I think because it's constantly refreshing that page I don't know that it likes that but it's cool well we'll make it work to your to your point and this was made it really super easy here since we kept everything the same we should be good to go so there's mode and you guys will see in a second if you've never done a transform map like this you'll see in a second why this becomes route so cool because I know we're writing a little bit of code in this but it's not anything that we'll have that you in the name okay so let's let's just try it let's try it without we can always add it so yeah if you've never done a transform map like this you'll you'll see in a second here why this becomes so much cleaner because I'll just write a little bit of code that'll basically map everything together which is all we're doing here did we do signal I don't we did signal I think we did you know what let's just take it in our in our transform app we'll just take it because at this point we can always just ignore data if we love to this might come up there all right cool being so save alright now theoretically we should be able to just test this so test load 20 records which will just give us the first 20 we don't have to completely process everything in this and we'll see what comes back interesting it doesn't like the table but shouldn't it create the table automatically okay so you actually loaded data in so did you do an import set from Excel and then to then import and then that just kind of created everything for you it just seems look all right well here you go you guys are learning live here Orlando this is one of the workarounds that we'll have to do is I have to work in in in in you know the constraints of what we have here so I'll create a little Excel doc and call it a day ship pretty easy you know all we're doing here for it's a table it has to exist before things can work it seems what the table has made it work exactly though so could you could you just create the table manually do we have to do it from Excel like I'm wondering if I could just build this import set table but then I've got to actually extend the import set table and do all that funkiness that it it's got I don't want to do that I would rather I would rather do it the right way and actually do like a little little import set table and just yeah I totally agree with you because then all the linkages are created so all right so let's just make this little pseudo table here so speed hitting yeah and then you actually have to put like some sample data in here with like data does this and make the import columns with the correct type I don't know can I actually have to put some data in here and die that's fine just one row yeah that's and put the Excel tables first time I create the required fields in the importance of table I didn't at least one wrote that yeah that's yeah I'm yeah okay so we'll just we'll just do it let's take let's take the let's take our time it's a bummer but you know what if it if it saves us some time and making this thing work a little bit better then that's fine and I want to I want to keep it as native as possible 13:18 I just you know there's there's something to be said about keeping everything out of the box and using the tools that we already have so interesting heading is padded so let's just see okay yeah that's a good point let me just do some that should be okay yeah and that's that's kind of where my concern is here is if I like for example heading right heading heading is 0 for 3 right but when I hit enter on this it just turns it into 4 3 which I guess we can figure out on the other end and it's not like I'm creating vectors or anything that I'm gonna try to actually send any of this data to I just want to see it stored get stored in ServiceNow so let's save this how can I do that with just the little there we go awesome that works okay so let's save this bad boy why did that that was weird okay just top light Tess yeah exactly yeah if it doesn't work the first time we'll do it again that's what I like about imports that's what I tried to call it and that should be enough I'm gonna hit go on this guy all right cool cool all right let's I wish I had a different button that's the only one I have programmed right now is just that one every time I hear myself say cool I when I hit it all right so I guess I mean delete it now you don't want to delete it yeah I should be okay with to delete that yeah so it's called a stream deck so you guys so this is a it's called a in it's an invite to stream deck and it's just a little USB device that has LEDs buttons and you can program it which is really cool and then you can actually page through it so for example I have my first page here I can actually change things on the stream I can hit all these little you know buttons and I can actually I can there's a there those are the three that I've got in the coal coal coal and then I can launch all of my stuff from here which is really neat and then I can you know I can put the stream in standby so well let me put it in standby real fascist so you guys can see what it looks like so it's it's it's neat right and it controls slobs that controls OBS it controls everything it's just much easier to switch between scenes and stuff so I love being able to yeah and it works I tried I tried using just my phone because there's a there's a slobs remote for your phone there's all sorts of stuff and and it's just it just didn't work properly so this thing is I'm like yeah if I'm gonna pay the money it's gonna work you know I'll put a support ticket in if it doesn't but it out of the box just works it's awesome it is so much fun the one downside that I have to it is it doesn't have a switch so I can't turn it off if it's plugged into my machine is plugged into my machine there's no there's no going back so that sucks but whatever all right I'm gonna delete this cuz I don't want this bad data in here and now we should be able to go back to our data source should be a test load yeah it's it's it's it's well worth it my guess is my tables wrong that's what I'm thinking now that looks right what let me see let me see it might yep yep you're totally right it's the you it's the you underscore yes I'm familiar with it I know I just did I don't know why I don't use that I don't know why I just I should use it more but I just don't I have no idea but a good lesson there even even though you're in scope it is gonna create these man it's okay there's probably a reasoning for it all right it's just let's see maybe this will work invalid target table why is it mad about that yeah it's trying to load Excel again using attachment that's am I in the wrong data source if it's not that's gonna be a problem if it is not in scope that is going to be an interesting problem okay let's just make sure that we're in the right table scope here there's the import table there it is right there and it's it looks like it's within my scope yeah so so it's not a scope issue and it did I just I don't know why it's trying to do this file attachment yeah invalid table import set not created invalid target table so weird I hit this button again and see if I'm in the right place I'm wondering if this is just the old the old thing the old logs in here and this is my heir maybe that map is wrong sure yeah um in the script yeah let's just try the static data are you thinking that the the actual mapping here is wrong so let's just run it with okay the correct XPath its selected some reason it didn't work when they entered okay all right well let's give it a shot agreed agreed the squawk coming as I said a number yeah it was okay yeah should have Oh No hold on before we go down this rabbit hole I have an idea I think I know where my ear is remember I call that let's look at the lawn ello n hex squawk there is no mode yep x1 flight [Music] lat/long this is totally different okay well my bet seeing messages speed I don't know what that crack helis track well if I don't know what it is I really don't care so seeing messages speed altitude long lat flight squawking hacks sick can come out of there come out of there this turns into altitude squawk in hex okay maybe come on what no that's the wrong I'm on the wrong video I'm getting to I'm getting tired now it's still saying invalid table No is that that's not it I think we're chasing our tails on this one I hadn't it wasn't sort of descending so my top thing it just says nothing okay it's like it's not getting anything back there we go that took it a second stuff's coming back I mean it comes back so what the heck wonder if I just hit the mid server never mind okay let's go to the mincer let's just yep line 18 should execute maybe I mean maybe it's because I didn't specify the mid server in there but I didn't think I had to if I put it on that on the message but we'll try an Tesla to Americans nothing mmm okay well let's let's start let's start throwing some log messages in here so this is I wonder if can I do I don't have my fanciness here where I can just inject that can't add a there was some cool stuff in our Elena where you can add a breakpoint that would basically allow you to execute some code so I wouldn't have to sit here and look at this but it's fine if that doesn't work hit save that's true and I probably should be that's what okay now I got to go into a background script this is oh boy I can't believe it's like it doesn't see anything it's like nothing's running okay [Music] yeah me too that's why I'm like and this is this just weird so we'll run this function the log is not allowed in the scope damn it I can't do print I gotta do debug info will info print it out just not in scope taps enough okay see now this is some this thing works hmm we're almost there I can almost taste it we're almost there I mean the other option could be that we just smashed this together and in a script include or something and just run it on a on the schedule risk alert how the script yeah and I'm wondering if there's some cross scoping issues here you want to try some static data all right let's see if we can just jam it in there all right which to be honest with you we probably should have done to begin with but we actually fixed a lot of a lot of issues that we had here I don't okie-dokie I don't know what that's gonna do we'll test load 20 records I did save or it should save when I exit it yeah it's saved yeah when you hit when you hit test load it actually does a full postback and doesn't save on it so we should be good to good to go it just didn't do anything yeah I know it's it's one of those things that I had to learn I I've built quite a few import sets that I could just click that button but I didn't do anything none damn it chase I thought you were gonna have something like super super insightful and we were just gonna like crack this egg shouldn't need to I've actually set these up where it didn't with no transform maps because then if you look at it there's a there's a run transform map or create transform map since there's what not one said here then you try it yeah but I don't see any data so I don't know how I'm gonna transform anything if I don't see the data okay so what if we did this a little different differently all right let's let's I don't necessarily believe everything that we we shouldn't lose everything okay integration so let's create a new action for integration house and see if maybe we can do it that way why not yeah we could try record let's rest I'm just not as familiar with it that yeah that shouldn't make a difference so I don't know webservice repose I know this is getting away oh yeah it's really cool so I know that this is getting away from what we wanted but we could we can use this I'd rather use the the new hotness right I know I'm still I love workflow I don't want to give up workflow do you do what no connection in line that's what I wanted okay so we use the mid server so way to set the mid server I know that there is but I really at this point since I only have one out know that I care that much now formed URL encountered okay that's fine and it did use my desktop mid server so we're sure mr. Reyes yeah I just wanted to explicitly said it just so that there isn't any like if I if I throw another bid server on here since that mid server is the only one that can technically talk to it I just didn't want it to have a problem okay so here's what we're gonna do we got something back Hey look at that okay so it is talking and we are getting stuff back okay cool cool cancel data is always good we're gonna hit publish on this and if we can get this done in the next 12 minutes that would be awesome okay switching back to this let's switch it to our rest integration hub format is JSON and we'll select our action well I got ahead of us I got ahead of us okay I got ahead of it it is the SDR hole that's okay I'm I think I think we're close don't know why it wants it so there's this data source request and then it creates my rest step so it it actually takes a lot of this out so I don't have to it just something was wrong there was this data source request that I should have created here but I didn't know that because I've never done this one before but we used the mid-face URL and then the resource path it created all the linkage for me so it took it took all the guesswork out but I did it I was too fast I was too impatient so maybe we have to publish it it would be my guess it's not published it's not accessible there we go path for each row for each element by I just want route I should just want route because I don't have to do some input starting with JSON array is not supported Oh No are you kidding me do I have to do that oh that's cool okay it worked so there's 20 there's 20 so let's look at the load of data okay there's something wrong here cuz like hex we're not getting reading lat but not long why is that happening we've got some of it hey thanks for stopping by [Music] okay cool okay so where are we at we've got the path we've got all this stuff so let's you know what it is I know exactly what it is I misspelled these names so I bet that this table needs to have you know what I'm gonna do we're gonna start again okay I'm gonna load all the records my guess is that I had created the table with all of that craziness in there and it didn't match up yep there it is so the problem was that the column names didn't match up and it didn't know what to do so it just tried to match up as much as it possibly could and what I ended up doing was I just putted that I put that too there and that too created a brand new table and then once it created the table everything just kind of slid into place there so that was cool all right so I now have that going now we got to go and build our transform map so that is our source here is our target tables so aircraft now again once we got all this up and running so this is dump 1092 aircraft I'm sure there's a better naming convention for this but this is what we're gonna do all right now this is my favorite because now all we have to do is create this field mapping so it's schedule maybe plan yep yep yep so let's do the mapping assist if you guys have never used the mapping assist it is super super super slick all I need to do is add my stuff there's my altitude and there's my altitude here's my flight there's my flight here's my hex there's my hex I know it's so old but it works it works so well long that might be all we have because there's just no kill that help speed speed and okay saris look mr. anonymous yes I know the auto mapping button I do not I do not trust it and it's not it's not anything wrong with it I just don't like that it's doing magic back there and if it doesn't work then it isn't great so like altitude and out it's obviously not going to find that flight in hex they probably would fight flight hex and lat it would probably find but the rest of them it would just be totally flummoxed on so we're gonna save on that so we've got all of our fields coming in here and I do have a col s I want to coalesce on flight so coalesce field if you're unfamiliar with the coalesced field will basically make sure that any of these anything that comes in here will uniquely identify and say hey if I see this number go ahead and update it if I don't see the number create a new record and the next time I see the number go ahead and update so I don't want to create a bunch of extraneous data I just want to update the flight information when I see a flight come over and then maybe we'll even add a journaling field so I can see when things are updated alright update cool alright now that we've got the transform map I can actually run the let's let's start a schedule here so scheduled if I could spell properly okay I recount I'm gonna create a new scheduled import okay do not run as me we need to run a system admin so that if my account ever gets disabled in my PDI why it would I have no idea but we're going to our 1090 and we're gonna run it periodically all right how often should we run this should we run it once a minute every 30 seconds I know every 30 seconds seems a bit intense but you don't mmm for right now let's just do it every 30 seconds yeah and we don't have any pre or post imports so we should be good to go so I'm gonna go oh I didn't set the data source duh I had execute now and let's see what we got the name of that table I swear I had a ABS no what where did my flight that's what I called it okay but it's not in there where the heck is my table aircraft is what I call it damn it do I not have a to it later I always say that I'm gonna do it later and then I never do boom oh I know six seconds in the top of the hour but we actually made it look at this look at this we actually made it so here is my flight now I'd really like to see this going to metric base or something that would be really really cool but I don't know that we have the time right now to go into metric base metric base would be a lot better place for you know we do some performance analytics we can probably map some stuff out and show it off but you know this is a good stopping point for us tonight the one thing that I will show you guys and this is kind of a zoo gotcha is this this Latin along here we would need to configure this to be a little bit longer so my decimals are a little short here let's go into here max length is 15 can i up that I'm pretty sure I can up that all right so let's go back mapping pages eh hmm yeah yeah that'd be cool let's do that let's do it that maybe may be a project for another night but yeah so basically so what did we do all right I now have all the information coming in from this CLI the CLI has an API that I can go in query yeah that'd be cool device specific stuff I may actually want to tie this into a flight aware so the flight aware database allows you to pull in a bunch of different information so instead of just sitting here and going oh that's cool I could actually link it to the flight aware and go oh here's the here's the flight numbers so let's pull one of these flight numbers here this is I know this one is a Southwest flight so I can pull this in potentially with the flight aware API knowing that I've got this flight number and I can grab all this information and actually throw it into into ServiceNow so potentially you know landing arrival times if we wanted to there's gate departures I mean we get and you know even aircraft type we can get super super crazy and this would be a great like CMDB entry right so you know what was the aircraft type how big was it so there here's the beef you know 737 all this information but yeah it's it's there avoid time oh yeah yeah yeah I know yeah the avoid the the actual arrival and departure times yeah it would get it would get hairy in there I don't know where I would actually put that but that would be neat but I know I know I've actually written so funny enough I've actually written a library on it it's one of my top community posts on the ServiceNow community site which is just here are some functions that I've written to get yeah I do yeah right yeah so if you guys don't understand what Jase is saying Arizona does not that parts of Arizona do not celebrate its daylight savings time which means that we actually flip between two time zones MST and PST which means sometimes we're the same as California sometimes we're the same as like Colorado and the Rockies yeah here I'll show you real fast we did a we did a large large project for four time cards specifically with how are our internal team are our internal users actually report time cards and one of the things that I needed to do was one of the things I had to do was get my password here where is my password I think I'd go to my login so anyway we did a large time prior to implementation internally and I needed to be able to do things like get the get the the the beginning of the week so not not necessarily the not the service now the side of the beginning of the week but I needed to get like Monday in certain things like that and it was just it was a pain in the rear I never have the right password for dev where is my you know I can get to it sort of as developer MVP haha get on Twitter you got it let's see where my posts so I'll shoot it over on Twitter but do you do there we go here it is is get the beginning of the provided date time of the week so I don't want to do this week I want to do here's my date and get the beginning of the week and it doesn't exist so all the day timer manipulations inside of ServiceNow you know just beginning of this week is great if I want to get this week but I want to get the beginning of a provided week so given a value given a date here's the provided week so I actually answered my own question here but I actually built this I built a bunch of different logic in here to get certain things based on you know a relative date based on the time that you pass in and this has worked out pretty well for me I'm not a date math guru but I hate date math so I didn't want to do it more than once and this is this is actually what I built to do that so getting the the first day of the week in the last day of the week which also you know would be like 11:59 on a Friday it's not necessarily you know what day or what time is that on Friday is is a good question so we pushed the that the time there but yeah I've done I've done daytime funkiness I hate it hate it hate it it is not fun but yeah so I I agree with you Jase I would like to stay away from time much as possible but anyway so recap what have we got we have a software-defined radio which allows us to tune into aircraft that are flying overhead of my house I have connected that to my desktop server here my desktop server is running the mid server my mid server is connected to my ServiceNow instance my ServiceNow instance calls out to a JSON API using an integration hub awesome that we very quickly through an integration have action together using the JSON format there and then I transform that from a the the import set table into my actual table here and we're getting we're getting all of this information it's not real time but it's pretty damn close it's it's you know every 30 seconds we're pulling this in so this is all the awesome information that we get here so yeah yeah if anybody wants to follow this up I think I think I think that's a great stopping point for today we've made some awesome awesome progress and actually shown that this proof-of-concept could work so one of the things you know if you've got any any real you know even older tech or things like that this is this is obviously something that's out in the physical world that then we're using the mid server to access and that mid server is really that bridge between you know everything physical and in your ServiceNow instance so we're using the printer the Mitch cert the mid server to bridge that gap and take things from a local local machine into your ServiceNow instance which is hosted in the cloud so super secure didn't have to open any ports didn't have to do anything in my firewall just had to install the mid server and get get some things running but you could see how we did it in about an hour here we got everything everything going yeah that's it's called an SDR software-defined radio but I have this the this the the new lecture the new elect and I will throw that in discord real fast for you here Jace there you go I get out on Amazon the reason I bought this particular brand there's two brands that you can get here and I'll just so if you do a search on Amazon for SDR rtl that's that you'll get all these devices back so there's some really cool stuff obviously like some smaller devices nano things you can put some some antennas on I like to be able to at least throw it outside if I need to throw it outside but I did I didn't get this brand this the this rtl-sdr calm is kind of the the de facto standard but for some reason these guys actually shipped out of the the Amazon warehouse by my house so I can get it next day and that was kind of the cool thing or even same day if I'm if I'm on if I'm on in the early in the morning so I got this same day it just came really late yesterday and I didn't have a chance to get on the stream and load it but you can see it starts getting crazy right there's a lot of stuff that you can end up looking at and there you know passive filters there's different antennas really you're gonna end up it's a hobby it really is a hobby you know amateur radio hams and I'm actually a licensed gmrs operator as well so I you know I've got I've got kind of this stuff lying around I've got a little bit of this domain of knowledge that I have and I just kind of want to match that up with service now because I thought that was really cool and especially if we're pulling in something cool like like airplane tail numbers I mean who else can say that they've got running that you know that running in their their ServiceNow instance right you can see oh that's cool so we actually got four more in since the last time it pulled so it is actively pulling these in as they're coming over which is which is really really neat so yeah if you guys have questions if you want to you know if you want to talk about this kind of a thing if you I'll throw links to all of this in the recap of the video yep Jase awesome I'm glad we had fun it was a quick little win and and and demonstrated import sets which was really neat so and I learned a lot so that was awesome so as always I appreciate you guys watching if you have any questions please hit me up on my social Phoenix dev if you know drop link in the discord and I will be editing this video and sending this out later so that everybody can can kind of see the digested version of what we did here today so alright thanks guys [Music] you

View original source

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