#ServiceNow #Discode vs #Fladvocate - We bout to PHX __it up!
hello and welcome to phil goes deep we are back we're live and this is not a virtual background this is not a virtual mustache this is real life right now live on the internet um and i'm very excited because i've been away for a while um and just to give a shout out for the movember you know this this uh thing that's on my face is to raise awareness for men's mental health and physical health so if you're a guy like me and you think something might be wrong just talk to someone speak to you know your doctor or a friend and if you've got any friends that you think might not be okay just ask twice you know just check in on them make sure it's okay to talk uh so yeah this is um 26 days in the making it's been dyed as well it's not my natural color but it will be gone in about five days time so enjoy it while it lasts um and tonight or today whatever time it is wherever you are we are going to be talking about discode and flow designer and i've got a very special guest with me if you notice in the title if you try and pronounce that phonetically you might offend somebody and don't pronounce it phonetically whatever you do and i've gotta just so i've got mark scott with me and i need to i need to bring him in but i've i've just got to switch over the uh just gotta switch over this self-view hide thing and um i believe i know i don't i've got it's been a while right hold on this is the one we're going to so fade it in cut it across mark your live you're live with us uh thanks for joining hi everybody hi yeah so uh thanks for the thanks for the uh thanks for the t up there phil um yeah i'm mark scott i'm the uh senior platform architect for now learning um if you haven't seen my channel uh my youtube channel i'm just getting off the ground phil's been awesome with helping me with that i'm very active on twitter phoenixdev the yeah so let's let's let's just let you know the elephant in the room here phil it's phoenix dev it's you know phoenix phx is the uh is the airport code but yeah if you have any if you have any questions as to why that that is the way that it is you can go check it out i have an explainer on my youtube um and uh yeah happy to be here happy you know excited to to to get into some some disco versus flab advocate stuff it's gonna be great yeah and i watched your explainer video and it made like i was oh okay now now i get it okay it makes sense so um you know if you read the video title for today um it's you know phoenix it's up right you know nothing nothing else oh man okay yeah so how did um how did that start because when i looked at your videos or your channel and i hopefully i've linked it in the description um how how did that start because you've got some videos on there that i wasn't aware of you've been doing some videos for a while i think and you've just kind of relaunched the channel yeah so it was i mean really you know you get into the that kind of habit of i want to build something i want to make something but you don't really know what you want to do right and and for me that's that's kind of a huge issue and i said you know what i just i want to do something i want to do a podcast but i don't want to do a podcast i want to do a video but i don't want to do a video and so i'm like you know what just you know publish not perfect and you know get it up there get something going uh and so i just i i kind of i came up with a format that i i kind of liked and so i you know no promises but yeah um just just wanted to to kind of get it going again and and what you had looked at phil was uh there had been some live streams that i've done with jason a few a few years ago uh i had a couple of clips from uh some some talks that i had done i had actually recorded uh my knowledge 19 presentation and put it up there i don't know that you know people can you can record yourself at these conferences uh who knew uh and and throw it up on your youtube channel so that's that's what it was none of it was uh none of it was uh you know organized in any way or fashion so it was just kind of a smattering of things and now i think i've got a more uh a more concrete idea of what i want to do so you know that kind of a format with my kind of branding and my name on it and whatever i want to talk about whatever i want to do and whoever wants to come on or hop on be a guest you know let me know we'll we'll get it scheduled that sounds great and um i hope i've linked it in the description if i haven't and you're live and you're it's not there just go to the main channel i've got the other channels linked you'll find mark's channel just hashtag feet phoenixdev fphxdev um and you'll find it uh for sure and i'll make sure it's linked in there by the uh by the time this is if you're watching it back on demand if you are watching on demand please don't vote uh because you will still be charged and your votes won't count so um i always like to put a disclaimer in there just in case we do vote for anything um so i'm not planning to by the way you look nervous when i said that so no i you know whenever someone says they're going to get charged i'm i'm like oh no like what did i do wrong like don't don't touch that like that's i need an adult exactly so uh and thanks mark because we we already had a bit of a session earlier right you come and join the uh the rangoo team um and came in uh on one of our dev forums and that was great we talked about flow design a little bit talked about what you're doing at servicenow on the now learning side of things which is a great platform for anyone that's into servicenow with just getting into servicenow and you need to learn a bit more obviously we've got the community and all the kind of peripheral things that go on around the community like this like your channel like the sndevs.slack.com there's the discord there's heaps of stuff there's you know linkedin ashley sn.com i mean the list goes on um developer.servicenow.com yeah but now learning is like the the the main library the structured learning learning paths i mean it's amazing what you guys are doing it's the official one at least yeah the official one exactly yeah that's official yeah it's official yeah uh and and what i think a lot of people don't realize is you know every everything that you're interacting with on now learning is coming from the platform right that is that is a service portal that we're building that is that is an application that we're maintaining it is a servicenow application and we we do you know we have upgrades we have we all the same things that customers and partners are going through um that's exactly what we're going through and that's exactly our experience and so it's awesome to be able to say that hey you know i got beamed up by the mothership but you know i still don't i still don't get to have back end you know i still can't go tweak the things that i'm not supposed to so i you know i enjoy being able to to you know kind of stand amongst the ranks and and still say that you know i'm in it and i use servicenow as a product every day yeah it's great man and um you do you do heaps as well so the the other thing that is worth mentioning uh is that you're also a titan of now so there is you know this is where i first kind of came across your name and and i was talking to someone recently about mid servers and i was like man mid servers are amazing i i kind of played with them a little bit like literally a tiny amount and then i came across that um video and i was like oh yeah actually that makes a lot of sense i just never thought of it that way so um again i'll make sure that's linked in the description because that talks you know about how you got your start and all of the stuff that rob talks about on there um with you so that that's amazing and congratulations for that as well so um we're gonna we're gonna talk about discode uh well we're not we're going to talk about flow designer complex objects in and we're going to try and use this code to to discover them so maybe we should get into a shared screen and i need to do something with i need to make myself disappear off of zoom um which there we go hide self view and then switch it over fade it in and you're here you're live and we've got uh we're down in the bottom channel uh bottom right hand corner uh so yeah and enjoy that space let's try and occupy it so discode how much do you know about it already mark i know we've had a quick quick chat i know i mean well so i've i've done a little bit of research into your videos right and just kind of scrubbed through them but from a and i wouldn't call myself an expert at any any means so i you know give me the elevator pitch i'd love to hear it because i'm i'm still trying to piece it together yeah so the elevator pitch i mean i'm not selling it it's it's on share actually if you go to uh the share site if you can find it um you go to share and search for disco um so i mean i like playing with with words i like language discode was kind of code discovery um and this code is like discover code conjugated so you know yes just just squashed it up because you know when i'm creating scoped apps which i have created quite a few of them and none of them have ever gone very far but i'm always trying to play with that limited character set and i want my scope prefix of my tables of my roles everything i wanted to just make sense so it took me a while to uh to arrive at that name because other names were things like design review because i was thinking well if i was going to be changing something on the platform i need to understand it i need to be able to do an impact analysis i need to understand this application and some of the early stuff you know we mentioned mid servers the first time i worked with a mid server was using um a feed from bmc atrium okay which was doing discovery of the infrastructure so all of those probes or whatever were out in the data center discovering things and bmc does a pretty good job of identifying devices and applications and dependencies within those things and it produces it in a csv file so one of my first kind of big development activities on the platform was was just connecting that into the cmdb and i remember working i was working in change management at the time and we'd get a change request it says i'm changing server you know xyz 101 and we go okay um somebody on the approval list knows what that is but from a change management perspective we didn't really have a connected cmdb and i remember the day we lit that up and connected it in and i built the transform maps and i took the relationships and man it painted this picture and then when somebody said i'm changing this server i was like oh that server there what that one that's connected to that right now we understand now we understand the risk and the cmdb business service map um is a great way to visualize stuff beautiful thing it's a beautiful thing and especially when you run when you finally run and and it and and service mapping is one of those things it's it's a lot like cmdb discovery right you have to iterate you have to iterate you have to iterate it's not going to be perfect the first time you've got you know you're going to have to go in and tweak and go in and change and it it takes a while to build that up the most satisfying thing i think in the servicenow world is the last like service mapping scan that you run that builds out that just beautiful chart where you're just like everything's there am i you know i've got network to everything i can see downstream of everything i can see upstream of everything it's like ah nothing feels better like nothing feels better to finally have that like kind of figured out yeah exactly and so that you know and everyone knows i hope everyone knows if you don't know get to know right the cmdb in the servicenow platform is like the where all the value is going to it's like a catalyst for value across the pla like if you think about itsm of course cmdb is important but you start plugging in all these other things and the cmdb isn't necessarily i don't think necessarily a just purely technical um or or purely like physical you know no it's a configuration item it's something it describes configurations right so it's literally metadata that's all but if you could say cmdb it's like a database of metadata right so it's like it could describe whatever you want it doesn't matter right like it it doesn't matter you know you build the class out and you set the attributes and you say this is what this is like this is how this is defined and then you just fill it in like i love the cmdb because it is like that i hate the cmdb because it is like that there's so many tables there's so many little like inheritance models and everything like it's just it's crazy so you know it's it's a double-edged sword with that too right you can you can uh you can you can model anything do you want to right but yeah there's gonna be so much modeling in there so yeah i mean the table there's so many tables but the other thing here we've we've discovered them you asked for an elevator pitch and this is like uh this is not the elevator pitch um i think the elevator pitch stopped code discovery um and and you know you can extend with the madrid licensing model cmdb tables are exempt and this is i think in the spirit of that agreement right these are cis so what i've got in in this code is i've started with your obvious stuff right tables business rules roles script includes and ui actions so each of those what i've got is a i've got a kind of disco ci extension that just extends from cmd bci disco main one and then i extend from that into all of my other classes so i can put some common stuff into my first layer but that's not really populated with anything directly so we've got ci roll ci roll ci table et cetera so um i mean look at this this is the second field you you i loved what you said you said that there was this there was a parent layer that had no attributes on it and and you didn't know if there was going to be attributes right so from from the from the inception of this you had built this with a with a parent layer that then had an inheritance structure that then went you know one two or three levels deep knowing that at the very top if you did all of a sudden think of something that needed to be done you already had it at that level and you didn't have to go and rebuild your entire data model to support that and i want people to understand you know but it was a one-off comment on your on your part but i want people to understand how important that is even building a table or inheriting from a table that has no attributes still builds you a layer in that later you can go and add attributes if you need to exactly that so i call that actually it's ci application file so ci application file is very much like application file assist metadata table right um and that extends from configuration items so i actually call it c discode which is my scope name ci metadata okay so it's like cis metadata ci metadata and then if you look at say business rule um that extends from ci application file so this is if i want something common across i can go and put it in there and it's it's then available to consume from all of mine so yeah it was a it was a design decision done early on which i think is the right one one that you can't do later you can't retrofit that in right right once you once you've made that decision you're stuck with that as opposed to the way that you've built it where you've built in some buffer where if you needed to put an attribute at every layer you could do that even though right now right it looks like a waste of a table it really isn't it's it's kind of a it's more of a um placeholder i guess you could say right it's a placeholder for what what might come later in case you need it exactly and to be honest to me it doesn't look like a waste of a table um and yeah i i guess somebody else might go why um but yeah it's it's it's there for a reason and you know on top of that you could put some logic on there you could put a business rule on that table which then is available to all of my children so yeah that that's a bit about the table structure you know the fact that it could potentially live on a customer's production instance and imagine if you're building applications on servicenow or even you you've got out of the box stuff um they could be you could you do incident management on them right and you say oh what's broken well it's it's that table or i've got a request it's you know the cmdb starts to still live within there i don't know if this would ever end up on a customer's prod instance and i'm not recommending that any customers out there put this into production just yet it's very much in a beta phase but the cons conceptually here i think we've got something that that's quite powerful so we were talking before actually um uh mark about inheritance and and all this kind of abstraction layers within script includes so i've got quite a bit of that going on here as well i i personally love it but let's take a look if i take um this script include right core base and i should basically be able to search for that as a ci because i've already scanned this i do think i've got a table in there um now if i look i'm seeing a table relationship lookup which wouldn't be exempt so i think i've added something since there um yeah look at this um core base is extended into core but core is extended into my scanner base i've got a ui action helper as well i've got a scan engine okay so i think this will extend more if i um show more load more yeah yeah load more so what i've actually got is this kind of concept of scanners being almost like a strategy pattern now i don't want to offend anyone that knows this stuff properly like um i've got a book but i you know i i'm i'm not claiming to be an expert here but it's hard to retain it's not easy stuff yeah but the concept here is almost like a strategy pattern so and i know i've got some of it wrong i know i've got some stuff that's like built in reverse it doesn't actually make sense because what we're doing here we would take and it and it doesn't jump too far either what we effectively do we pass in the scope name let's look at some of the properties that we've got here so we pass in um that's a default so comma separated list of cis scope names so if i ran i've got flow designer running regularly scanning um everything by these scopes okay so it scans the scopes now when it scans those scopes it then also scans these tables within them and if you look sysdb object is my table cis script is business rule script include obviously ui action and user role so i'm scanning those tables for those scopes so i say go and get me all the tables that exist and i scan those tables those then exist as cis right right then i go and get the business rules on those tables so it's very much like if if i was going through the process and saying well i would like to know you know i don't understand how this thing's built i need to know how this thing's built so what i would do my kind of default position there is i'll go to the table name i'm just going to pick on a table that i love sn compliance control i would say dot config okay so dot config is effectively what i'm doing here i'm passing in the table from the table i go and get all of its related things so i get its business rules now those business rules are quite possibly calling okay that one i don't think i'm so i'm not saying business rule i don't lint this at all i mean if you look at the linter in instant scan it will you would be able to understand that you've done a you know a a query so you're doing a read um and an insert it would be possible and i think we can find this stuff out like we could say well you know what this business rule actually inserts over on that table as well i mean that's something that i would really like to be able to do is understand this table gets its data from these places um it was like a service map between the tables based on what what we see the inserts being yeah exactly on this i'm not going to this level yet so i'm not looking at glide records but if i do make a call to a there so that potentially that script include let's see if we let's see if this has worked or not so if i go to that um script include are you gonna i'll be showing up no okay so that one hasn't been that one hasn't been found yet but potentially we would see this business rule calls that script include can you pull your screen up phil i don't know i'm not is it too is it too low yeah i'm not seeing oh do you know what it is um mark i realized on zoom which you know we're talking over zoom here i'm not sharing my screen to you am i no no but i'm not sure that i'm seeing it on the are you watching it a lot on youtube with a slight delay oh man i'm sorry okay that's amazing i can't believe i've done that okay so i thought maybe they were seeing it because it through obs but then i i like i scrubbed through a few i'm like i don't not seen it at all so i'm not sure uh that's my bad let's see if i i don't know can i can i share my screen or that break there ah now i get it right okay so i don't need you i do need you mark i don't need you i don't need you yeah no that's good take you out there and i believe we fade you in and then put you down can i put you there man you're you're looking a little bit looking a little bit small i've sized you out hold on i think we're good oh no no i see let's see what happened all right hold on hold on fade you down this is what live streaming is is all about when you know when you're dealing with professionals like myself so can you see my screen now yeah i can see it and you know what you were right it was on the it was on the stream but i couldn't see it before i can now this is great this is smashing i love this excellent i told you man it's been a while it's been a while drew had a question in the chat um and i've completely missed the whole conversation beforehand i think it's you know let's just shout let's just give everyone a bit of a shout out shout out to dhruv shout out to jay shout out to balor thanks for tuning in balor great to see you man um upside down andrew where are you man went out for a meal went missing shut him out and he just goes away yeah ah nice to have you on tonight uh thank you i didn't miss jace did i shout jace out of course yes i mean jace is kind of implied he's on every live stream every servicenow live stream has changed on it i mean yeah it's implied but it's great some of my some of my earliest channel views came from jace's website jstop pro um you know i was seeing i was looking at the analytics and i was like jace is linking to my stuff man and i didn't know jay i don't think i'd ever actually spoken to him at that point what a cool guy what absolutely cool guy yeah just just makes makes stuff for no reason like yeah here's this news aggregator that is going to become like the lifeblood of the servicenow community like yeah for free yeah when i was two i was talking about all that those peripheral things um and i didn't shout out jstop pro at that point but if you want to find servicenow content don't go looking for it go to jstop pro and you will find all the stuff that is being aggregated that's out on the internet i mean yeah for no reason um loads of reasons in there man it was for his own reasons but it was it was like look at this thing i built yeah for no reason sorry jace i didn't mean it was for no reason i meant more like yeah i was like yeah right i'll just build this thing like it was nonchalant i was there when you built it you're like man i'll just build this thing it'll be all right i would say it's probably jace is probably one of the most altruistic people in the community that builds things for no benefit no direct benefit for himself and it just benefits everyone um i i think that's what i was hearing when you said for no reason um yeah yeah but anyway yeah i know i know you weren't trying to upset anyone and i know yeah so dhruv had a question and that's where i was getting to um can we use it for debugging i mean you can use everything for debugging man when you're debugging something like use everything you've got available here's what i would say is there's there's a lot of times where like you just don't know i mean you go through business rules but you just don't know you know how prolific that business rule is on that you know either either through the table or if it touches multiple places or if it's just run i don't know differently than what you're seeing in the view like i would love this thing to be able to go and scan and have a list of all my business roles where i'm like hey if you're gonna go touch that table you go make sure that you're you know hey you're running qe on all of those business rules right every single one of them like it goes into my my my use case or my my test case right that i assigned to my qe like yeah of course like you got to go test all these things i think my qe team would love it yeah and what you said there about if you're going to go and touch this thing that was kind of where this idea started from for me it was i'm going to go and touch this thing but what does that mean so if you didn't have this or something like it what are your options you've got to go to the table dot config look at it now what i've been doing a new app comes out or yeah new version comes out i just scan it and then go what i didn't know that was in there um i want to see here assessment engine i'm wondering whether something's not quite not quite perfect we've had like well last time i checked had about 13 downloads so look assessment engine there so assessment engine is you can see now is getting called by these business rules so if you were going to go and change this script include guess what you've got all these things hanging off of it yeah so you know that's where i do i like to do this sometimes just just for you know try and find a view that that makes sense yeah um if you there are some things that i've scanned and gone whoa like that's just very heavy and and obviously the more you add into it the the kind of harder it is to see and i know there are some things that you can do on the left to filter and build views and so on um there we go that's coming now sngrc item table i mean you start to see all this stuff but you see like 20 here so it's it's telling you there's 20 business rules i'm not going to show you them unless you need to i've also got different types of relationships in here so you can see this table extends to this table so all of this logic all of those 20 business rules there are probably available and running or potentially running here plus the ui actions and then you can see also the role so um yeah this you know this role is inherits or extends um all of these roles but that role there can access can delete can create as well so i've got the acls built in so i can see that user role um you know and that gives us another i mean like if you want if you want to answer drew's question here oh okay what was this question can you use it for debugging like um there's there's an acl debugger right there like i don't know of anywhere else where i've seen an ac like i mean i'm not saying it's an acl it is it is technically an acl from all of the information that you've got there right it's how is how is the access controls granted on this table but this this tells me exactly where all of this stuff came from and why you know what where what inherited what role and and how you know how what what grants what right on on this table like that's that's huge for debugging i mean that's to me i'm like yeah like like that would be amazing to be able to spit out it gives you a visual you know that's the main thing i it doesn't give you the i don't think it gives you the detail but you know i can spend quite a bit of time in this view you just saw it there it did hang a little bit so i don't know if it's because it's too heavy or if it's you know the pdr if i might have some crazy crazy relationships going on but um yeah i mean look at that you just you start zooming out sngrc admin is extends into here but then you know that that person there has got kind of well not that person but that people with that role have got all of this permission so i i think we've framed the the concept of this thing that's great and kind of how we do it is still a little bit um a little bit in the in the kind of realms of the obscure let's see if i can connect my hopefully my vs code is is connected while you're doing that i'm going to give you an update on chat here so yeah please um yeah uh dhruv says that he's going to download the app just just just from this conversation you've converted him by the way andrew upside down andrew says his instance is 10 years old and they have 400 plus custom tables this would be so useful for them um just just on that um it's 10 years old i'm i'm guessing uh that the a lot of those tables are in global oh i mean come on phil like back in the day all your tables were in global right like unless unless you've come unless you've come full circle into the you know the the altar of scoped applications it yeah it's all in the wild wild west up there yeah i'd i'd be very concerned about that um maybe andrew maybe andrew will chime in with if all of his tables are in global or not i think a good eighty percent of uh a good eighty percent i would guess um so caveat glow says yes yes everything's global it's got two scope tables you don't have to worry about cross-scope privileges they're all global so it doesn't i don't think handle global very well at the moment um i'm not sure if i've just been scared to let it loose on global you know because this is always the problem with discovery we were talking there about earlier about you know your standard discovery the normal result of your first few scans is noise oh yeah absolutely just pure noise yeah and then you it's either no it's either complete noise or utter silence right it's like you got nothing like nothing came back white noise um yeah yeah yeah yeah the opposite of noise is white noise all right i like it i don't know if that's true um i don't know it was either but yeah i'm a bit worried if you let this thing loose on global and it doesn't at the moment it doesn't do hops really it's it's quite it's quite linear um it's you know turn it on let it go yeah you give it the table and it then finds all the things related to the table obviously script includes don't have a direct relationship to a table so they come in from a different angle so this is where i've got i'm going to see if i so i'm in my hacktoberfest um workspace there let me see if i've gates is asking you could you could theoretically run it on global right you just haven't and i think i think the answer to that is yes yes we don't like it might start running and never come back exactly exactly so um i don't know where my it's you know it's been so such a long time since i [Music] did uh a stream on and when i stream i use um i use a different account so that i don't see it you know none of my work stuff's on here uh i don't know where my i don't know where it is i was hoping to pull it up on on vs code it shouldn't be too difficult should it for me to connect to my instance using famous last words i shouldn't what it shouldn't be too difficult so what do we do go on go on so i interrupted you no no no uh it it [Music] i would assume as as someone that has worked in the cmdb a lot and has written an application that goes through and pulls a lot of things uh back out uh you know there's a lot of recursion there's a lot of recursion like there has to be like in it's just the nature of what you're doing uh and so you know you end up with a table that references a table that happens to reference the first table and there's this some weird loop in there like i i understand your hesitancy i i could see that yeah but to jace's point you could do it i just haven't and i am a bit scared of it so if andrew's saying oh that will solve all my problems it probably won't it might create more confusion i don't know i mean for you know if you've got a spare instance there like i don't know i don't know your stack if you've got a sandbox or somewhere that you can install something and it's not going to conflate what you're doing by all means give it a go man i mean i i don't think would you say safe harbor or um just you know you're like a disclaimer it's on you my friend like yeah try it like for sure but yeah put it in your put it in your um pdi first see what it's doing have a look at it and see if you'll see if you feel comfortable um using that don't even start a dev instance he makes no uh yeah yeah andrew says he would he he never said it would solve a problem yeah fair enough fair enough fair enough uh he did he did say that uh run it on global and unlock the secrets of the universe but dhruv did mention the doors of hell which i think might be closer to what you know yeah but yeah it's on i mean it's on share so it's not like i mean you guys are asking these what if questions just like go download it and try it out you know report back and tell us what happened exactly exactly that so look i've connected i've connected it so i'm just going to import i said it's not that difficult i select this code in here i just did my authentication off screen um i know on live code in happy hour you have like a privacy um bush and so on but um i was trying to do a little you know tap song and dance and it's on share go download it kind of a you know filler you know uh jason i just want to know how long does this a scan normally take so i would assume on like a brand new pdi with demo demo data installed how long does it usually take does yeah it depends right that's only going to get longer the the more things we the more things we scan into it but if you go to [Music] i was going to say no slash command fd right shout out to arnold uh another another guy that's out there making everyone's life a little bit easier oh my gosh for free for free he's he's that man that man alone that man alone has probably saved hundreds of thousands of hours you know the the the service now the servicenow ecosystem you know definitely owes him a paycheck or two uh because man that has made my life so much easier big big shout out to our noob there yeah excellent so scan all applications is a flow that's going to go to my property and scan all applications i don't know if i set up sub flows yeah scan all applications so that that subflow is consumed in the main flow but in the actions you've got scan application okay so in here wow you see you've got it down you've got it down to a single action that will just go and scan an entire application scope that's pretty cool exactly so if i say test this now um and it does it so how long does a scan take how big is your application you don't know do you scan it if you depends what you're scanning as well right so at the moment in those properties i say kind of six tables i think off the top of my head um you could change those tables you could add more we could add more scanners so this is built in intent intending to be kind of uh extensible so if you look at um what we've got here in terms of script includes right obviously just take the base as as the main one this is just a structure that i do like um global right now oh we could try it oh no we could try it let's do it application name don't do it uh run testing background or run it in the foreground run it in the background i think it's going [Laughter] oh no he did it chester's finished running okay there is a property isn't there that allows you to see this in more detail while it's still going or i don't know i've i've not seen that a little stressed as uh that's weird yeah i i usually don't see that maybe i haven't been running in the night maybe your flows don't take as long they're finished oh but you did run it as background i see what's happening okay so you did run it as background yeah just kind of yeah i don't usually run my flows as background i don't usually have a reason to i i haven't been doing a whole lot of heavy lifting so i mean that's running in the background so what you can do here if you go to kind of discode uh in the i feel like this is is somehow killing my instance let's just go back to the main yeah it was there that scanner global is somehow killing your instinct now i feel like the business service map just isn't isn't that friendly with my browser at the moment i'm not sure but if i go into [Music] um actually i'll tell you what i want i want that main table so in the studio i told you ci application file if i take this table and just do a list on it we see there three three four nine three and then if i just refresh it it's gone up so you know something's happening something's happening so um you know i that that's kind of how i monitor background flows that uh is anything happening yeah yeah uh the record is changing yeah you know what my favorite my favorite is the uh that moment of like oh no when like you're running uh you're running a script in background and you know that it shouldn't take as long as it is and you're doing something you probably shouldn't be doing and you're like and then you kind of figure out what your script problem you're like no no no no it's like the damage is already done i mean like would it just that when that spinner comes up and i'm like that shouldn't it was 36 records it should have updated why is it spinning in in tsql days you know begintran was like embedded into into just anything even if i was just doing a select all right i would still begin tran just just to make sure just in case i used to tell a joke i used to tell a joke a mid-level developer will begin tran and a senior level developer knows to end transaction because that's someone that's done it and walked away and locked the whole database i've done that yeah yeah uh guilty guilty so i mean we were talking about people in the community and shouting them out i mean we've got a shout out james neil uh he's been on the show as well um explore it gives you the cancel button i mean i know you can go into the background and um you know find your you know find your transaction and so on but having it kind of there and seeing the timer if things do seem like they're taking a little bit too long um you can cancel them but i i do will then worry about i mean it makes you feel better yeah you're gonna get hot yeah i don't know if it's better to cancel or not better hope you audited those tables [Laughter] this is still going up uh balor says um uh ballast balances we can by the time this finishes basically um we could do a whole service now training so um how many hours of content are on now learning uh i don't know it's gonna be it's gonna be a lot it's gonna be a lot there's there's a lot and and there's more than there's more than even i knew right because they they're constantly changing things and putting more content on and so uh i was talking about uh i was talking about a you know a specific need that i i thought needed to be fulfilled and someone was like have you seen this video and i'm like and it was the the person i was talking to was in the video it was david giamona who i i think you know people have seen on twitter and stuff but he was actually in the video explaining exactly what i was saying you know we should really do a video that does this and he's like have you seen this one and i'm like oh so they're always i mean there's there's there's a whole team i mean there's teams of people putting stuff up it's it's crazy and and maintaining it right with each um you know bi-annual release uh it's so uh jase asked a question in in global at the moment we've got 1 1404 tables now some of these might have been there before because if it finds something it does create the ci for the thing it's found it doesn't then it's not like a spider it doesn't keep going out it it kind of limits itself like when i said it's linear it'll kind of just go in one direction and stop but i know other discovery probes are kind of like i've got here what else have i got and then it it just keeps going out and you know you mentioned the recursion it's it's not doing much of that right so it's not that clever in the in the scan engine side of things um in in terms of how it's built we'll let that run for for a little bit um the good news is running in the background so you can you know we can still do things on the instance but we've got this core base this is where i define a load of constants and then i can access those constants things like properties table names i can access them i don't know if anyone's ever built a scoped app before and then wanted to change their scope name uh yeah like every person on earth so i've done that um and i've been burnt so what i try and avoid doing is hard coding my table names into my glide records so i actually access my glide record through my constants and then if i want to change them i change them here guess what if you change scope um it's possible to change your scope and just kind of leverage your code you just change it here so that's kind of what's going on we've got i mean that's good that's a good anytime i define a hardcoded string in my script i tend i tend to make it a constant right and it needs to be defined up at the top or or at the very least if it's not defined up at the top it needs to be defined in a sys property or something that's easy to you know pull back in because yeah it's it's not fun to have to go and do a full text search of the platform for every instance of you know this dot whatever and go and change you're gonna find some search criteria that falls slightly outside of that and if you try and do a replace all you'll break stuff and then you'll never recover from experience anyway i mean maybe i was doing control in ephron but yeah this is an art form after a while yeah searching is a skill um so the problem with property names mark is what do you call them and how um naming conventions for me one bit of advice i received quite recently and and i think i'd kind of done it sometimes go macro to micro if you in in doubt if you don't have any other options so that might mean that you see weird table name column names like name underscore first and name underscore last and it's a bit jarring when you do it the first time but then after that actually it kind of it pays off it makes a lot of sense yeah and especially and and to your point in scoping right when you make the scope understand that you're going to be stuck with that scope so if you're going to call it this you know as long as it lets you call it like you're going to have to call that every single time you need to call the api properly like very similar like you you know make sure your scope names work out so you know your table name you know scope.table makes sense it needs to make sense yeah it should like it should read you know fluently i'm not going to say english it should read fluently it should make sense yeah and call it what it is right you know um be be verbose and be explicit call it what it is and you singular table names um always singular if you can you know what would a single record on this table be called and that's your name for the table yeah um because because uh again as someone that's gotten burned when you call it with an you know you add it it's plural with an s at the end the system will sometimes try to add ies or s at the end because it's going to pluralize it for you anyway again like i should you know the system's telling you what you should be doing and it should be singular so getting some questions coming in here about um about numbers right so i've got two at the moment on there we had 2608 it's still going up 3036 tables in global um and in in here how many tables have we actually got in global i've i've never asked that question before so you can find out very easily uh cis underscore properties i mean it's one of them that pains me um but i also enjoy it it's one of those kind of nice pains if you know what i mean um i think eminem had a lyric about it you know yeah it's one of those weird things where like you've been around long enough you're like yeah i know i know we say singular and then we're like but what about that one it's like you don't touch that one like don't don't don't even go there yeah don't do it like that but it's fine like i've got plenty of those mistakes like i'd if i think i heard this from ajb andrew barnes shout out to andrew um i'm i don't know if he's got it from if this is his words but i can hear it in his voice when when these words are spoken it's like be kind to your future self you know so you're what you've done in the past might be wrong um and you can't really go back and correct those things you can just learn from them and next time do it do it in a way um that's better for you next time that you'll appreciate yourself later so be kind to your future self and and things like cis underscore properties i mean i don't know who created that table but i'm sure i'm sure they know who they are well if if i if it's who if it's the team i think it is they got their stock they cashed out it's like yeah oh well like they made their product right it wasn't perfect published not perfect stuff exactly you know and i'm not hating on them so right what we've got here this to me is is something that looks like it's probably errored it's probably crashed out i don't know but i've it's it's kind of peaked at 306 one and we've got four one five two total so we've got tables four one five two and here 306 one and it's not going up anymore so to me that's a bit of a clue that maybe things just crashed out okay that's what i'm guessing why why crashed as opposed to finished oh why why did it not error gracefully have you you mean no no i mean why is it there are handlings in the future is on the road map no no no i would never ask a developer why isn't there no air handling in this that's evil that's mean um no what i was saying was uh you know be positive maybe it's maybe it's finished yeah i'm cynical man especially in from debugging perspective i'm a cynical guy testing everything i'm negative like i'm trying to find things wrong i expect if i go and check is it syslog or is it cis logs i'm not sure i've never i've never actually typed it i've always typed log and then scroll sys logs dot filter no it's neither of them it's oh do you know what it is it's one word it's this log dot filter talk about naming conventions yeah yeah i love it man i love all this stuff if you watch that have you seen a video with um chuck david lew beau and the lady from the service desk i've forgotten her name but they went back man and didn't they have a 2012 instance or am i no they did a 2012. they did a 2012 live code in happy hour but then at knowledge they did a a chat with the kind of like a side chat i think it was yeah yep and i love i love some of that stuff so right let's just have a look oh i clicked all damn it says it scans finished okay see i told you phil like come on i've put some pretty okay um stuff in here so when was this two minutes ago scan finished interesting that it didn't find all of the i think this is the scanning application file name why is it file name i don't feel like that's sufficient to say that it was successful um let's just pick on one of these tables man and just you know because it's a ci if i open it in the form that's the one i really want to see is task oh that's probably where that's probably where it broke but yeah i mean it found some relationship so you know from here from viewing it and the menu and that ci record um it links here to basis metadata which is the original file and that's another thing from a from an extension point of view you know you can you can make a reference field to the the parent table you'll see it like in task incident parent will probably be tasked but there'll be a reference qualifier that says i want to be the same class name etc so here i just link to um link to sis metadata you know reference to there so it could be any application file that will point to it if it's a script field then i it so if it's a business rule i actually capture the script as well okay you know what i've realized mark in in the hour that we've kind of been on um we're not really we're probably not going to crack open um a complex object in the hour i mean i'm okay with that yeah look so look at this script here right so it actually captures the script i was trying to do some stuff like baseline differences as well i was trying to use the cmdb's baseline thing so you can actually track the changes to your comparisons yeah you know over time and go well hold on a minute i had an incident here everyone started complaining about that on this day but guess what we can see on that day that ci changed uh and and go back over time right so the funny thing is if you've got some bad script this starts showing up in instant scan i found stuff in my like ci ci table because that's a script field um you know new glide checks i've never even seen that before new glide checks on but then using like you know health scan could you correlate that you know this bad incident or i'm sorry this this incident that this user said this went down with this change now i mean that's getting pretty specific like you you'd have to know you know i mean you'd to be able to correlate you know from a users like i just stopped working i don't know i mean some of the other what you're throwing in there i think is great because you're bringing together the power of the platform and why couldn't you why wouldn't you do that um because the scans have in scans findings checks all join up based on a target and the target is a document id so if if your target is this here then um you know you you could potentially correlate here your findings related to that target object you could see here the findings on that thing you could initiate a scan from this um the other thing that we talked about as well was kind of knocking around this idea you know it's been something that's been going on for a few months and it's not had any activity for a while but some of the things we talked about were like understanding the risk of an object like understanding that this thing here just don't touch you yeah every time we touch it you know it's got a 50 fail rate or something like that yeah it's just gonna cause pain um so yeah i mean let's take i don't know how long we want to go just looking at the chat um do the other tables are in other scopes incidents on scripts cis is cool i don't remember the exact uh there is one table called ah sorry i wasn't following the chat at the time so what this does we've got an object table map as well so it says from here look no scan equals true so we don't scan that table um syscript include is store so this is our target table in the instance this is what is represented in this code and this is the field map so what we do we take the name field from there and put it in here i know so name field from there and put it in the name field there so this is our map so this becomes extensible as well if we want to start pulling data from our target like here condition we pull condition in for ui action we also scan conditions as well because if you've got a script include um or a business rule not a script include sorry a ui action or a business rule that is calling a script include from a condition field that dependency should be known so i've got a relationship for filters by wow okay i never would have thought of that that's that's next level wow so here's my scan engine base so we you know we've talked a few times mark about flow designer and how to consume your application from flow designer how do you kind of publish those end points so what i've got here is my public methods right you can see they're not denoted with a prefixed underscore that makes them public even though you can publicly access anything else if you want but i've got a method yeah the action sorry scan all applications scan application um so that takes obviously a parameter that's enforced through flow designer this will scan an application file and we pass in a glide record of the file there it basically takes scan applications so scan all applications will look up my property get application list get source applications that looks up the property for each of those applications get the scope name then scan the application uh i'll call it public method just so that if it's overridden for some reason you can use it if you're using public methods your users should be using public methods yeah so that's going back in this takes the application name i wrap that in a try so i've got one try catching it across the whole thing because this is where the danger zone is you can see their log scan so i've got a method for actually publishing out the logs in the properties we actually set verbosity and so on so you see that level there one that level one is like this message is a level one message um look there that's a zero so that's always going to get you can't on you can't not have that one but this one is like only if you've got your levels turned on to one and you can then enhance your your error login um or just your general logging in here scan application file so does that get called um scan application there scan file that looks like the wrong name have i got a scan file have i changed have i changed my function name and not now let's scan file there okay so that takes the file specifically gets the source scanner get source scanner is now my strategy it's like if you look in other things get strategy it returns here var it's i don't know if you can see what i'm doing here so it's a factory pattern yep i see it but i'm passing in new york and i'm actually instantiating using the name of the api the type of yeah yeah there because that's the object scope level and it's rather the new disco dot i'm using the brackets to pass in the object yeah and i was i'm quite happy with that to be honest um no i love that that's a really cool that's that's a great implementation so that returns the api so when i say get source scanner down here um and i think all we'll do uh mark just for time is frame the problem maybe for for another time um get source scanner gets me my api scan and then i do api scan run so what would my source scanner be well if it's a certain type or a certain type then you know so if it's a business rule this is going to be the the scanner that i'll get back to scan that file if it's a script include this is what i'll get so this is where it gets a bit messy because i don't think i'm consistently saying i'm here and i'm going from here to there like sometimes i'm taking the thing i'm into and trying to work backwards and sometimes i'm trying to work forwards and i don't think i've got that um i don't think i've got that sussed out in my head yet okay but it basically yeah it's a bit this is where it gets a bit weak i would say this is where my actual scanning capability really needs to be improved because i'm just doing some hard-coded strings i mean look here new um and then looking for brackets but what if you actually instant what if you that should actually be here right because if i've got a bracket but what if i've got a space and and so on i don't take account of that and you can't search by regex right you've got regex you have to have the string and then test it against your pattern yeah you can't you can't do it in reverse yeah you can't say get me all the things that match the pattern i i don't think well i mean you could read you could read the entire blob of text in and then do a regex match on everything that i mean you drop out every i i don't know red jack small enough no i know i don't think it'd be very performant yeah well first of all you're doing a string a string search so it's just it's going to be terrible yeah it's good performance for regex just so this this is where i know the application can definitely be improved so that what i need to have is consistency in terms of what comes in and what comes out you know 101 stuff for for functions right but this this ability here to have like scan script include scan table scan or scanner right that gives us the ability to add in more and more uh and then like we would scan flow designer scan flow designer objects so i think if you look at a flow designer object you've got something called in tables i should look at this in um in disco really shouldn't i uh complex complex up let's just see if that has let's just see if that has come up at all um just curious in your discord scans yeah just to see if that was one of the tables that got scanned and if it if it give us anything in there mean i'm not expecting we've got the table okay so we just see that it extends it's not connected any logic but if you look at that table dot list it's like a it's just a bunch of it's a bunch of json which could be your action so i think in in did that finish did that error oh look at that cannot find function get message in object type okay told you it aired man why didn't you believe me stack overflow ooh a stack overflow area nice so yeah i mean it there we go we we tested global i think this is a complex object you're happy you're jackals like we tested it they were they were cheering us on yeah i know they put they really pushed um so i think in in flow designer that's like a complex object that's a com you know these things are complex objects each i don't know what would you entity would you call it right each entity exists as a complex object within a flow designer slot yeah i i think so and so this stuff here json is i've had a little look at this stuff before like basically i took some objects that i felt familiar with and i just did a you know json pass and looked at it as an actual object right right so i think it is possible for us to kind of crack these open in some way and no because take case in point flow designer here scan application guess what run scan what's it doing new scan engine right so i should know that that script include is being called by these flows these actions and these actions belong to these sub flows and these subflows belong to these flows and these flows are actually getting invoked from a ui action on that table like you that that bit is missing from disco right now so that was what i wanted to try and solve today mark but we've uh we've shot the breeze is there anything you want to see on here i'm just mindful of time man um anything you want to see on here before we zoom back to um you know and an outro uh i mean phil we've covered so much stuff like uh i love i actually can flip back to your uh your script include there especially like even your uh your base script include because i wanted to point out i i just i i want i wanted to say how i absolutely 100 percent appreciate your coding style i want to i want to point a couple of things out that i don't think a lot of people are probably looking at when they're looking at the screen right um each one of these functions be it private or public are actually listed alphabetically right i can see that right it's like that's not that's not intentional oh really it's not no look we broke down all right so there's there's a coding style that i like i actually like to put my functions in alphabetical order and i thought they were as i was reading through them i it looked it looked good it's like wow i've done that without even realizing it man that's my laugh so it tends to be my last step after i've written my code i go and move it around and make it look pretty so that nobody yells at me um but yeah i like that i like the fact that you have you've got to do's listed here you've got some comments listed here your your your structure and your style is um uh sn is the sn doc's style that i can pull out on some of them i've seen some of them have it right it's i but but but i understand this is a labor of love so i don't want anybody to look at this too closely but but there's there's a lot of good things that i and and and i love our talk about your constants and how you actually set your constants here um is this what you mean sn docs thing this is js dock right is this what you would refer to the these yeah doc standard is sn doc standard yep yes because and in vs code this is the beauty of it right it's it's self document in there so but what i want to point out is this is your labor of love code right like this is just something that you're putting time into and and you will see value out of it but as of right now you're not getting value out of it but the fact that you've kept yourself so clean and you've thought about your implementation and you've architected before you know you thought about it and architected it before you started writing code right that's huge that's big that's that's that's something that i want people to really understand is like i i can tell you've put a lot of thought into how this is going to work and to see it work with that factory pattern i call it a factory pattern i you know i don't know what other people call it but yeah i i don't this is why i'm like i don't know man i'm if i start naming things i'm going to get it wrong i always say strategy because that's where i've i've seen a strategy thing and i'm like okay i'm going to call it that but i think maybe you're right maybe it's a if it's well i like the way that it's being invoked you're building an object based on a parameter that's being passed in right that's really like and that when if if in your brain i just broke object oriented programming for you good like that's the way it should be because it does break that and it makes you kind of think in a different dimension where you're actually like okay now i have to figure out how to like instantiate these objects without knowing what in what the actual concrete implementation is that's called an interface pattern right like you know it just we get into all the cs stuff and it's just so much fun but i love to see other people doing it because i don't see it a lot like i don't i don't i don't honestly see it a lot and this is where like when you see something that should be super complicated simplified this way it just makes me happy it just makes me so happy to see this yeah but thank you man and uh it is a labor of love but it's i would say there's probably more love than labor right now because um i just have like i put it out there i i was very happy to get it kind of published on on share just to say like that that's done now i can i can sleep um and just wait for feedback so if anyone is using it or has used it and gone you know what this is this would there's like i want to get it into git as well so that you can broad you can fork it and you know do whatever and you could then track issues in there as well um but other than that i mean it's just really that's what that's why i love that's why i love that you know the community is the community chase where's chase jace phil needs phil needs a hand getting this in to get and and getting this set up so that someone can public you know a public repo so you know that's help help help fill out i think i can i mean jace is a busy guy man i know he's got his hands full i i yeah i mean i think it's just the doing it and that's all it is mark i think it's just doing that and you know i think it had 13 downloads when i last looked um i'm trying to think how we bring this back to to outro without being too i don't know i'm i'm famous for my abrupt endings so all you yeah i mean i guess i am i don't know like i've only put one video out there so so we just can't like just cut the stream just don't say anything bye and that was it hold on man we got it we got it better yet you just awkwardly stare into the camera there we go it's just us now there's no code on the screen i believe okay right um yeah so outro yeah just on the on the the way you organize your script includes like the way i do it is not alphabetically um although maybe i do without without realizing it consciously yeah somewhere deep down you're doing alphabetically and now i've seen that g like one started with g and it was at the bottom that's that's going in there's an issue so um what i try and do i try and i i put all my public ones at the top okay it makes me sad when i find a public method buried below oh yeah yeah um so yeah i try and put the public ones at the top and what i'm doing now i'm communicating to the people that maybe look at the code these are the things that this is how you interact with it and everything that's private is the functional stuff that makes it work not the things that you should be calling so i was then trying to reading yeah look here i'm not hiding it from you like it's right here yeah usually use this bit right um and that's where i'll spend time maybe putting some comments into the actual interface but then i will try and order it so it's in a the order that things get cooled in but you can only go so far with that because then you'll find that one actually gets you know it uh which one where does it go yeah so first one kind of wins there but that's how i try and organize it and maybe that's where you say well do you know what alphabetical afterwards yeah i could say that i could say that because i like it the reason why i like it alphabetically is because i can find it yeah i don't have to see it and i don't and i know where you're headed with the functional because you can see each call and where it you know where it goes in the stack and and i can understand that um and and and very often i mean i was a consultant i have to you know i had to drop into a code base that was you know laid out the way that you'd like to lay out so you you kind of have to adapt um the way i like to do it is alphabetically and and um i've learned from a couple of different people like it's just it's so much easier for me to go i know that it is a private function so it should have an underscore so automatically i can already see it's about you know midway through the page because it's down to the private functions i know it starts with an ass for save so i know that it's already you know about three quarters of the way down where you know the private functions are like i can almost get to it without knowing the line number um but i can i i mean i don't think that there's a right or wrong answer to this right i think it's all personal preference and like you definitely is yeah it's labor love so you know it's it's tabs versus spaces all over again it's not it's not anything anyone's doing right or wrong it's really a stylistic choice and i think you know if you're a good if you're a good developer you can come into any any environment and you can go oh okay that's the coding standard yeah all right and and just roll with it yeah and you can have a good open honest conversation with people about their standards and why they like that sort of preference like i've had some really good conversations with with people about how they do things and why they do it that way and just see if you know my style might actually change and um yes certainly i think the main thing i've learned with coding standards and and just best practices um you know obviously they're a point in time but it's choose something and stick to it as much as possible be consistent that's the key is consistency it's fine it's fine if it's wrong but be consistently wrong yeah all if if you've got oh we always put a period right there and it's just dumb do it all the time because when you're doing a text search and replace later and you've got that one space where you were like well i'm not going to do it this way i'm going to do it yeah i'm with you oh do it wrong if you're going to be consistent be consistent if you're going to be wrong be consistent and wrong but what i have found is just some people just don't care about that stuff and they just never will so you know they're and that's their style and that's fine um it's frustrating sometimes but fine so um you know everyone's different man everyone's an individual and maybe uh we should we should wrap it there uh mark because i really enjoyed having you on the show thank you so much for your time um maybe we'll come back and we'll crack open a complex object or or not we'll just leave it out there for for for you know for everyone but what we're doing is reversing out flow designer i mean that's really what if if you want to get down to brass tacks what what you're actually trying to do is reverse out how does flow designer actually work and i am incredibly interested in that subject so yeah let's yeah let's get it scheduled but let's do it yeah that's would be nice to just point out a flow and just go visualize that that flow and its dependencies um that's a nice idea maybe we'll spend an hour just doing that without all the intro without all the chat uh well we're still with some chat but thank you so much man um everybody that's tuned in feedback is welcome on on disco on the channel any ideas if you want to get involved as well like i'm i'm up for people jumping on uh on on the stream i in fact i would encourage it and then um don't forget to check out mark's channel phoenixdev phoenix dev ph yes p h x d e v check that out man um and you know i'm sure you're gonna have lots of interesting guests coming up uh mark so i i have a feeling you're gonna be a guest on the show soon phil wink wink nudge nudge that's why we need to wrap this one up right and we'll just yeah man let's uh let's leave it there uh thank you so much once again and and and take care everyone stay safe thanks for everyone in the chat um all the best man and um yeah see you on the next one awesome thanks everybody thank you bye you
https://www.youtube.com/watch?v=zHZER3baJoU