logo

NJP

Let's talk about Platform SDK 🤔

Import · Jan 27, 2024 · video

[Music] all [Music] oh hello good afternoon good evening and good morning to those in the American time zone welcome to Creator toolbox a show brought to you by the service now developer program Channel by your lovely developer Advocates where we demo all the brand new features that service now has to offer in the upper right hand corner of your screen you will see right by panov's head that we are doing Washington DC content so the Washington DC release came out in Early Access on February 1 and so now we are running through all the amazing new things it has to offer this is just one in a myriad of things that we have been doing so if this is the first thing you've seen congratulations there is more to learn you can see the rest of that at thank you so much FR of at devling dosn Washington now we have a phenomenal guest here to walk us through the now platform SDK but before that let's do a quick lightning round of introductions uh like I think I already said my name is Laura McManaman I am one of our developer Advocates and I'll kick it over to the man to the right of me PR up hey everyone I'm also senior developer advocate here at service now and I'm going to pass it back to Patrick hi everybody uh really excited to be here longtime listener firsttime caller uh my name is Patrick Wilson I'm a a software engineering director at service now um and I'm here to represent the service now SDK well we couldn't be more excited to have you Patrick and his entire team including Jay are kind of suffering from their own success um we've kind of noticed that their the SDK is pretty much one of the most talked about features on social media we've seen so we've strapped them into a bunch of cool stuff there's already an episode of breakpoint where they kind of talk about the products history how it's kind of grown and where it's going so if you're interested in that please check that out as well and with that that being said though this is a visual medium So today we're not going to be podcasting we are going to be showing you this brand new feature so with that I will kick this off with a question first which is what is the SDK what is it what is that as a feature yeah great question so the service now SDK is um effectively what it is is it's a a a procode tool a CLI tool for building applications and scoped apps on the service now platform so what the CLI is all about is it allows um developers or anybody that's writing code and comfortable writing code to write code locally on their own machine uh it provides a mechanism for taking that code that you're writing on your local machine and pushing it up and pulling it down from uh a development instance that you're working against the service nowes you're working against and it gives you some new capabilities that you haven't had before in the scripting layer in the service now platform uh two really big and interesting features which is the ability for me to um organize my code the way that I want to organize my code uh so instead of being locked into for example maybe your uh maybe in your scope dep you have a lot of business logic and you're uh taking all that business logic and you're dumping it all into one of some small number of script includes and you're editing those script includes in the platform itself you don't really have any means to to organize that code the way that you want to or structure it into modules and subm modules the way you'd like to uh the service now SDK gives you a mechanism for doing that and um like uh really exciting part of the SDK is it allows you for the first time to install and leverage a thirdparty libraries from the node ecosystem and from npm in the applications that you're building on the platform so uh over the course of the last uh few releases and especially in the Washington release we've put a lot of work into making our uh scripting engine our Rhino scripting engine on the platform more and more compatible with um the the The Wider JavaScript ecosystem like the node.js runtime so that we can do things like pull in really useful thirdparty libraries and use them in our apps uh that's libraries like low Dash or like momentjs and more so that's what the service SDK is all about it's a it's something fun for proc coders so that's a really interesting way to also get people that have a stronga like a traditionally strong JavaScript background to like dive more into service now like it kind of makes them halfway of like prac is and soft because you said you're using visual studio which is like the industry standard so it's nice to kind of meet people halfway with you know not always having to do every single thing on service now too exactly yeah that's something that we've heard from a lot of people and um I mean I've built a lot of apps on the service now platform over 10 years so you know it's something I've I've always wanted which is man you know I I want to write code I I love that service now lets me write code and lets me write JavaScript on the platform that's really cool um but I don't necessarily always love writing that JavaScript in a little script in a little script field in a in a form in a browser right that's not necessarily the experience that I always want it can be really convenient if I just have to like you know crank out a couple lines of JavaScript real quick for something that I'm working on but for those cases and those times when I'm writing a lot of code and I'm building a lot of maybe Rich business logic it's nice to be able to use industry standard tooling to be able to do that and that's sort of the path that we're converging on and offline too like you don't have to be on wifi now essentially right sure yeah you don't have to be you know there's um I'll show this as I'm when I'm using the CLI but um you know the only time that we you really need an internet connection is if you're taking your changes and you're pushing them up to an instance yeah absolutely I I I'm so excited to see it Patrick like you mentioned about couple of things modular JS load JS and I think I'm super excited so so can can we see it now like do will you be showing us a more demo about it yeah would love to all right um all right cool so um I'll be kind of walking through sort of a flow of using the service now SDK to um we we'll create a new application together and we'll start to get a feel for what the functionality of the of the SDK is the different capabilities that it has and what it feels like to actually use it so over here in my screen I'm showing um actually well first quick plug for our documentation site um this is where you can learn about how to use a service on SDK how to install the SDK we'll walk through all of this together so I won't I won't show B you know show you to sit here with the documentation open I suppose um and uh just kind of some table setting I have an instance here set up this is a Washington instance so if you request like a PDI Washington instance or something like that you'll be able to follow along as well everything that I'm about to show um is only supported on Washington as the earliest release so if you're on like Vancouver or something earlier you know you won't be able to use the SDK until you make it to Washington so I just want to set the table there um so we're showing a procode tool a CLI tool so unlike most products in the service now space our journey doesn't start here our journey will start right here so here I've opened up a a terminal a command line interface here um and here I have displayed the command that you would run to install the service now STK I want to make a couple of notes here just really quickly because it's a little bit different than the way that service now typically ships software so the service now SDK is shipped um on the global npm registry now npm is also called the node package manager if you're a JavaScript developer you're you're familiar with npm uh that's where people take globally you know across any company take code and they put it for consumption third party libraries and things go there it's also a really convenient way to distribute software and that's how we're Distributing the service now SDK here so if you want to install it you could install it right now on your on your machine if you'd like to it's it's there it's available you would run mpm install DG Global at service now SDK and that's how you get the SDK when you run this I won't run it I already have it installed it does take a couple of minutes to pull down all the codes sometimes um but this is how you can get the SDK installed on your machine and once you've run that command and you're installing it globally which means that anywhere on your machine once you've installed it you can run now- SDK I'll say d-el which is a common pattern for CLI tools and you'll see that you have the SDK installed on your on your machine so this is what it's going to look like once you've installed it and it even gives you kind of a helpful rundown of all the different commands that are available to you here like how to authenticate how to create new projects Etc so that's how you get the service nowk there's always some questions about how do I get it how do I play with it it's really easy you can do it right now if you'd like to um so from here uh where to start so let's start with um authentication so um what we're going to do here is we're going to create a new application um a new scoped app so we can start playing around with some things before you can create an app you'll want to um authenticate with an instance probably the development instance that you'd like to use maybe it's a PDI maybe it's something else um and to do that we can run now- SDK off now what off is is it's our utility in the service now SDK for authenticating with different instances you can set up different authentication profiles if you'd like I think I already have one set up let's see off list oh uh now SDK off list um I do I already have an instance set up if I did not like if I did not yet authenticate with this instance in fact we'll simulate that let's let's clear out our o so you can kind of manage your authentication profiles here now let's create a new one off um I think it's save default there we go Target host so this is where you'd start logging into the instance that you want to develop against in this case I'll type in my um URL for the instance that I want to use this weird looking URL that's an internal t URL for instances that we have here at service now um here you'll log in you'll log in with your basic authentication credentials that's the uh authentication mechanism that the now SDK supports as of right now um I'll log in as an admin there we go so once I've done that I'll see that I'm fully logged in and now I can start actually developing against my service now instance really easy so this is still some of the boring stuff here so let's get into some exciting stuff this this is cool I haven't seen this type of thing done with service now don't discount it it's really sorry not boring really exciting and very thrilling really exciting stuff and Patrick like right now you created this app like can you show us what kind of artifacts that got created in service now back end so I haven't created anything yet so far what I've done is I've logged into my instance um and uh next what I'll do is I will actually create a new application now that I've now that I'm all logged in now that I'm connected to uh it's this instance over here that I'm going to be connected to so now that that's all set up um let's create an app uh and that's where things start to really get exciting so what I'll do is I'll run now SDK create and if I run d-el I'll see that there's a little overview here of how I can create my application the different commands that are available to me so I'll say now SDK um and from here I'll say create I have to give it a project name let's call it SDK demo um I have to give it a scope name with this really important make sure that you use your vendor prefix for scoped apps um your instance your development instance will have a vendor prefix that whatever instance that you develop on that's the prefix that we use at the beginning of um scope IDs uh so make sure you use the right one here if you don't the the now SDK will let you know that you use the wrong one so it's not a huge deal but here I'll say SDK demo and I will also add a t um a flag here called sample table so when I run this command what it's going to do is is going to go and talk to my instance it's going to create and bootstrap a new um application for me a new scope dat for me it's going to pull down all the artifacts from the instance that represent that scoped app and with the help of this-- sample table flag it's also uh going to bootstrap a table definition for me as well which is really useful when we're just kind of playing around with things here so I'll run that we're bootstrapping the app um here we can see that it's generating all the files that it needs to generate for the app now it's logging into my instance it's deploying the package to my instance and there we go so we've successfully created an application as easy as that um let's take a look at it on the instance we can navigate to this URL that it provides for me we can use that to go and check it out here we go so here's my app the SDK demo app really awesome and we can see that it's already created a bunch of application files for me um but I don't want to look at my application files in the instance I'm you know using this Pro code tool I want to look at it in code so what I can do is from this point now that my my project is all created I'll open it up and VSS code you can use whatever mechanism you like for doing that I have this handy little shortcut called code you can configure that through vs code I'll open it up and here we go so here's my project and now SD the this SDK demo app that I've created um if we look around here we can see over here on the left that um just by running that create command um a bunch of different files were created for me right and I can take these files I can check them into git I can make a new git repository in whatever git provider that I like to use here internally we use GitHub um you know different customers may use different types of git providers of course so consult your it Department about where you want to put source code um but this is what these are the files that I would check into get right and we kind of see some things that maybe look familiar if you're a JavaScript developer if you've built JavaScript apps in the past a lot of this will look pretty familiar to you you've got this Source folder and in that Source folder we can see that the the now SDK created for me this my function. Js file that already has some code inside of it so that's useful this gives me kind of a starting off point um I can see some other things I've got my package.json file this is where we can see kind of an overview of this application that I'm building and this package.json this is something that would look familiar to you if you've made any other like a node app for example anywhere else right um and we can see that I've got some scripts set up we'll use those I don't have any dependencies yet but we'll change that and the third thing I want to call out here um and then I I'll pause maybe for any questions is this metadata folder so to talk about this metadata folder I want to give you kind of an understanding of what a service now scoped app is and if you've done scoped app development if you've ever checked a a scoped application um into git before like if you viewed like the source code for a scoped application you'll recognize some of the things in here it's a bunch of these XML files right these XML files represent metadata and artifacts that um make up your service Now application um so here I can see that I've already got one artifact here it's this cisor script record this happens to be a business rule so if I can go and open up this business rule um if I go to let's see here's that here's that sample table that I made uh you'll recall that I typed D- sample table in the um in the creation command here and I can navigate to this table and we can take a look at our business rules so here's my table very fancy very fun I'll go to configure business rules and here we can see the business rule for this table that was created kind of automatically as part of the um are you uh I just want to confirm something uh which screen are you currently showing are you still showing the my function screen or did things freeze oh I switched screens I'm okay it we lost you so currently it still shows the source file my function. there we go perfect is it good okay I think there's a pretty SE severe lag on the there is a little bit so I apologize on that one it's okay um yeah it's as I'm seeing comments it's not just me no it's not it's not just I think there's just a delay in the screen share so um but now you should see um like a the instance UI right are you yeah so um I'll try and account for the fact that there's a little bit of a delay here so now I'm looking at a um a business rule screen um hopefully you see that um and here I can see so I just wanted to pull this up to show that this is like the UI representation of that XML file that I was showing over here in VSS code land and now I'm looking at vs code this is that business rule that I was showing so we'll be flipping back and forth a little bit hopefully we're not seeing any more severe uh screen lag here but um this kind of the short version of this is that this metadata folder in the um in the generated code in the source code for my SDK project uh contains all of the the service now stuff it holds all the XML it holds s all of the artifacts that represent stuff um like my business rules like my scripted rest ACLS like my UI Builder Pages whatever it is it'll show up in this folder um we also have this Source folder down here and it's in this Source folder where we're going to start um defining JavaScript so this is just a normal Source folder it's contents aren't XML they're just a bunch of JavaScript files and I can organize these Java files JavaScript files whatever way I want and I can import this content into my uh business rules or really anywhere that I can execute serers side script so let's see an example of that here I'll kind of show you how everything sort of plumbed together here and then we'll start actually writing some code and we'll start getting a sense of what it feels like to actually author some code here um so here in my function. Js this is created for me um very helpfully by the SDK just as a little starter script so we can see how things are wired up and we can see here that I'm defining a function called show status update and I'm doing a few things inside of here I'm using GS which I'm importing from the service now SLG Glide package this is where we keep uh and publish all of the like type definitions and everything for service Now API so that you can use them in your code here um and here I'm just logging out a couple of info messages just to kind of show how this is plumbed and how it all works um I want to import this show status update function into my business rule and luckily if I flip over to my business rule we'll see that that's already happened so now I'm showing the uh the business rule screen uh on the form uh in service now UI okay um and here we can see this line of code right here and maybe I'll bump this screen size a little bit so it's a little bit easier to see here we can see like the new addition to the service now JavaScript runtime this is like a new feature in Washington which is the ability to require um content that I've defined in a uh as part of a service now SDK as a module so this is like a new scripting uh runtime API that we've created this require uh statement and you would only use this statement if you're using the service now SDK to uh to build and manage a scoped application that you're working on but here we can see this required. Source myy function. JS so uh this is a a commonjs import statement and the file that I'm importing is the file path that I was showing in the in the service now SDK that was the contents of that source file right sourcy function. JS and here I'm pulling out of it this show status update uh function and now that I've imported it I can actually use it in my um you know in this case it's a business rule but I could use it in a script include I could use it in a script address API really anywhere that you see a script block um and that script executes on the server side you can use this new requir statement to import these modules that you're defining which is really awesome and if I try and use this thing so we'll go to my uh we'll go to my table um um I'll open it up in a new tab here so here's that uh custom table that was created the business rule is sitting on top of this um I'll create a new record just really quickly here hang on it's catched up there we go okay now we're CAU up um this is just a basic little table so I'll just say status weip and task is test just like a little to-do list basically yeah um and now if I make a modification this like maybe I'll set this to done awesome we'll see that the the the business rule fires it Imports that script and it logs out record updated the old status was Whip and the new status is done and that's being logged by if I flip back over to VSS code that's being executed from this code that's here so now we can kind of see how um the uh the service now instance and a server script on the service now instance connects back to this code that I'm writing here and it all kind of gets stitched together through those require statements um pav you asked a question a really long time ago about what are the artifacts that are actually created here um those are the artifacts that get created here um any other questions sorry scared me to see my own face sorry yeah that that was me I I just put I thought of putting Patrick so Patrick right now we don't I don't see a lot of question one common question that I'm seeing is like uh in the documentation there's a version of nodejs that is mentioned right so should we use that or should we can we use the latest version also you can use um so you can use any version of nodejs um as long as it's relatively recent um like if you're using like a um any version of node that's on like long-term support you should be fine um we I I we late identified a bug that we're that we're we're going to be fixing in the next patch um where you do get like a warning when you install the service now SDK if you install it with the latest node everything still works it's still functional we just log a warning is because of like a misconfigured nodejs like minimum version flag in our actual project um you know the only thing I can say about that is sorry you know we we'll do better but um we will be fixing that next patch and that's actually maybe something useful to talk about here over time we'll be releasing updates to the service now SDK and because we're deploying those updates over um npm we're not like bound to the uh family release schedule or anything so you know when a new family release comes around like let's say that uh what's what's after Washington zanadoo when zanadoo comes out um you know that's not like you know oh I have to wait until zanadoo to get like a new version of the SDK in fact we'll be shipping it'll be minor but like minor updates to the service now SDK at a regular Cadence between now and then so um you know you can regularly check back to um uh npm um the the um the the site where we're hosting this SDK and you can check for new version updates and very often like if you're having some sort of an issue we may have fixed that issue in the form of a bug fix and released a new patch for it so um that's one thing that we'll be fixing but you can use latest node it will work you'll just you'll get a a little warning message that says uh oh you shouldn't use this and you can ignore it it's that'll go away good question awesome and Patrick like uh how how we can switch an application I know there should be a command like for example I'm working on application a and I want to go to application B like how we can do the switch is there any command to do a switch so the the um the application that you built here this source code um a a service currently a service now SDK project is um backed by a single scoped application so everything that I'm writing here like if I created new um like JavaScript files for example right um those will be a part the metadata that gets shipped to the to the instance will be scoped with this scoped app so it'll be a part of this scope so there's no real notion currently in the service now SDK of like um like switching app Scopes or anything like this is the one app scope that you were working and that's kind of an important thing I want to call out about um how the service nowk is behaving at least in this release is that um there's kind of a one toone mapping between a scoped application and and a service now SDK app so you can't make a service now SDK app that's like that that um encompasses multiple Scopes um currently um you I'm interested in hearing you know what the audience or what other folks think about that and if that's something that they'd be interested in uh maybe you know maybe we do something about that in a future release but currently that's that's the way that this works there's no real notion of like switching Scopes or anything like that gotcha because there's a normal notion for developers like when I'm working as a developer inside service now instance I can easily switch the scope and do a client script in a different scope or move to a global one that's why that kind of switching thing came up and the second question is like Patrick this is something like I'm also interested in it's like how we can create columns for a particular table if you have a table that's created how we can add columns I think in a my function like you have so how we can add those things can you show that yeah totally so there's um and actually that's a really good Segway so thank you um I I'll I'll maybe instead of showing it through table I'll show you through um like maybe we'll make a modification to this business rule and uh we'll see kind of what that flow looks like in the service SDK and that would apply to really anything that you make uh on the whether that's like schema updates or like business rule updates or anything else um the the flow will be the same so I'll kind of show it to you that way so um here we have my source code which I'm editing here and then I have this metadata folder which contains right um from here let's say that I want to make a modification to this business role um so in this case it's uh maybe I want to change the name we'll do something basic um in order to do that what I'll do is I'll edit this record so to edit this record click here now I'm editing it in the context of my scope right so far everything feels pretty familiar um we'll call this service now SDK business rule something like that um and I will save my record okay so I've made a modification to this record on the service now I don't think anything is I I I I think it might be some internet issues on your side Patrick because we're also more video a bit um nothing has updated yet on the screen at all oh gosh is my video and everything okay or is it it looks like you're in a cloud it's very foggy it's like H it won't focus yeah that's my camera sometimes my just decide to go blurry it's not an internet thing you um could you perhaps stop sharing and try sharing again yeah yeah yeah let's try it um I'll stop screen okay I see that my camera is there we go okay back and forward and then it refocuses but um let's try one more time share screen it happens no worries can't control the internet all right share that I guess that's the risk of live streams right is yeah there we go now we see the business R screen is that now so now I'm scrolling do you see that yes yeah that's might it um yeah there's also some audio issues I don't know if it's from my side or it uh I don't know whatever it's f um okay so getting back on track so what we were doing was we were making a modification to this business rule I might have done it off screen but all I did was um I changed this name of this business rule and I saved the record that's all I've really done so far so now I will flip back to BS code where I have my local source code and this is in like my local file system right and if I go back over to this XML file I'll see that it didn't change right it it says that the name of the business rues still log item change so like I've made some modifications on the instance and I haven't pulled them down into my local file system yet so that's what we'll do and I'll show what that looks like um so from here I'm in the root directory of my project here and if I run now- STK fetch I'll just log d-el to start so that we can see what's in here um we can see that we have this utility that will download application metadata and update the local metadata folder so what that's saying is it's going to go and talk to the instance it's going to take all of the changes that have happened in my scoped application since the last time I fetched it's going to pull down those changes in the form of like XML records and it's going to update this metadata folder so by fetching that's how I get my local source code here up to date with what the latest is in terms of the work that I've done on the instance because I don't want to author these XML files by hand right I want to like use like the the the UI or something to edit these these uh these um business rules and table definitions and everything else so what I'll do is I'll run now- SDK fetch that's going to talk to my instance it's going to download everything and ooh bunch of stuff came in so these are all of the XML records that are associated with the scoped app that I'm working on uh really since the last time that I've run a fetch right and in here we'll see this cscript record has been pulled down as part of it really it was already there so what we did was we pulled down an update to the um to this CIS script record and inside of here we can see here we go that this name is different now so now the name is service now SDK business rule and that's the change that I've made on the instance so now what we start to kind of get a feel for is you know I can do work locally on my machine I'm probably writing and editing JavaScript files locally on my machine here in this Source folder because this is a great interface for writing code and then I'm pushing it up to the instance and then when I'm doing things on the instance like updating my table definitions or updating whatever it is right then I can run a Fetch and that'll pull those changes back down again and my source code always stay up to date so if I took this and I checked it into get someone else could pull it down and they'll have all the same kind of um uh state of the application that that I have here um so we've shown pulling down changes we haven't showed pushing up changes yet so let's make a modification to our Javascript file um in this case maybe I'll say uh gs. addino message hello world something like that so I'm adding a new info message here in my source code and I'm going to save this I want to build these changes and I want to push these changes up to the instance and we'll kind of get a feel for what that looks like um real quick though before I do that one kind of cool thing I don't want to breu to this too fast is because I'm importing these uh service now apis from npm or at least I'm importing the type definitions for them um this gives me all this really nice intellisense which is pretty cool so I can write like you know right here it fills in for me that Glide system this is the Glide system API has this method on it called add info message and I can hit enter and and create it which is really useful for like authoring code locally um you know I don't necessarily have every service now app memorized I'm sure you know there's probably at least a couple of people on this call who do I don't and this helps me kind of remember what apis are available to me and remember the names and what the parameters of them are and everything like that which is super useful see in this case I can see that add info message takes um a message parameter which is of any type really and I can say this is my test something like that I have a really loud keyboard I think you can hear it through that that's okay hey's moving like lightning now so no complaints from me oh I think stopping and starting the screen share like got streamyard to like fix it or something I don't know so that's awesome um anyway so um we've added this line so let's check it out now um let's say uh so I've saved this file now what I want to do is run now SDK build so the CLI really it's just a fancy build process right and if you've done like any other development in like basically any programming environment you'll be familiar with this notion of a build step what a build step is is it takes an input in this case it's our source code right and it turns it into some sort of a build output which in our case is an artifact that we can install in a service out instance it's all that XML and stuff I'll show you what that looks like here in just a sec so I'll run now SDK build it's going to initiate the build process it's lightning fast because it's building very little code but um there we go now I'm all built real quick what I'll do is I'll I I'll deploy this and we'll see it working and then I'll show you a little bit of what happened when we ran that build command for anyone that's interested um so I'll run now SDK this is the final command that I think we'll talk about today which is deploy um and what deploy does is it takes that thing that I just built um and it will ship it off to the instance that I'm logged into so that it can um uh install and then I can see my code actually running so I'll run now SDK deploy logs into the instance deploys the package and Bam so now it's deployed what I would expect is if I come back back over here to my uh business rule uh or actually I'll go to my table definition because that script is still being run from my business rle I'll set this maybe back to work in progress here we go so now I'm logging hello world so that's what it looks like to like build some new changes and then ship them off to the instance that's amazing that is so so cool I'm loving this it feels good it's really nice to be able to write like I've my whole career I've been a JavaScript developers so it's really nice to be able to on a service now in like still doing service now app development but now I get to like write some source code as part of that as well um any questions here I can talk a little bit about um maybe what was produced here or should I talk a little bit about third party libraries and stuff um we see I see a couple of questions I think they good go ahead R go ahead no I would just I was just about to say like we can probably show the third party application also because uh third party modules how it can be there yeah sure um yeah let's let's let's flip over to that I'm I'm seeing some questions in the chat um there was there was there was maybe just like one or two that I want to just quickly kind of address here um there was one about is it or will it be possible to directly create business rules and script includes from the CLI I think that's really awesome question um uh currently it is not so currently in the Washington release of the service now SDK the there's kind of Two Worlds that you're living in right there's the world where you're writing your source code you're writing your JavaScript and we'd like that world to be in vs code that's the right kind of environment to be doing that and then there's this other world you're in which is where I'm like creating business rules and script includes and doing other stuff um that is that represents like the service now entities that I typically edit or create those things happen on the instance and right now there's kind of there's almost like a firewall between them right where it's like you know you do you do the instance stuff on the instance you do the code stuff in vs code um in the future something we're working on I can't you know I can't like commit to things like delivery timelines and things but um something that we um you know would like to see happen on some timeline is um the ability to kind of bring those worlds together and say like you know I want what I want is is like a single experience for um authoring everything about a service Now application and code right like I I I don't want to leave VSS code I don't even necessarily want to leave code in order to do things like Define business rules and Define tables and all that kind of stuff that's something that we're aware of um it it is a direction that we would like to evolve the service now SDK um you know non-committal language about like when things like that will come out yeah um yeah that's my answer there safe harbor Safe Harbor Safe Harbor thank yeah I saw a comment you're backing us up on that um Co let's let's do some third party libraries sound good sounds good to me all right cool so um you know at the beginning of this I kind of said hey like one of the really awesome things that we want to be able to do here is uh pull in and use thirdparty libraries from like the mpm ecosystem um so I'm going to show an example of that I'm going to show that example with um you know like I said I've been a JavaScript developer for um a really long time and uh in that time one package that I've become pretty dependent on I would say in the code that I write day today is a package called Low Dash um for those that aren't familiar low Dash is like your like Batman utility belt for for writing JavaScript it's a library that contains lots and lots of like utilities inside of it basically I've even seen people in the service now space like build their own like utility libraries that ends up overlapping quite a lot with the functionality of low Dash um and I love using it in applications that I build I haven't been able to ever use it in like a service now app that I write at least on the server side uh and that's fixed so we can do that now so I'll show an example of what that looks like um from here uh from my vs code down here in the bottom I'm typing into the terminal I'll run mpm install low Das so that's all I got to do right this is how I'd install like a third party library in any node project or JavaScript project not just not just this one but I've run npm install loow Dash there we go it installed um real quick we'll we'll show what happened there I'll click over into my uh package.json and we can see that we've pulled in a dependency on low Dash now so now we can see that this low Dash dependency was pulled in um and now what I'll do is is I will use it in my code so uh from here in my function. Js I'll write import let's see there is a f there's a function in here called uppercase I'm just typing and it's already kind of filling in the the the suggestions coming from low Das which is really awesome but I'll hit enter there import uppercase from low Dash um and now what I'll do is like I'll convert this hello world to um to uppercase there we go so now what would happen is I'm using this low Dash utility it's kind of a boring utility but you know it's it's a nice one to convert this hello world text to the uppercase version of hello world so now what I'll do is I've made some changes to my JavaScript right so that means I got a build uh now SDK build there we go we're building we can see that we're building low Dash here now too so what we're doing is we're packaging up low Dash the the dependency and putting it onto the instance now I'll run SDK deploy got to got to deploy my changes there we go it's taking all that stuff and it's pushing it up to the instance for me now if I flip back over here and I make another modification here we go hello world so right there we can see oh my gosh I'm like using a third party Library which is very very nice for me at least as a developer that's awes awesome yeah I love it so um uh you know of course we support more libraries than just low Dash I'll uh show another example of another library that we can use here uh and then I'll also say a few words about the the limitations that we have currently in Washington around like third party libraries which is a common question um so I'll run let's install one more thing so I'll run npm install moment uh momentjs is a popular JavaScript library for doing like datetime related things um and I can npm install moment there and then I can say import moment from moment here we go and now what I'll do is I'll says. add info message um how do I do this it's moment dot um you know what when in doubt look at the documentation do it man I don't have everything memorized unfortunately here we go I can do [Laughter] this so I'll copy paste that code in there save that npm run build and npm run deploy uh npm run is just how I invoke scripts in the package.json file it's like a nice little shortcut here I've mapped it to now SDK build SD de place so um I'll do that I'll build it's building moment it's poly filling the things it needs to polyfill it's deploying the package to my instance there we go and now if I come back over here I can see bam that it is Tuesday and that's coming from moment so moment has all sorts of like really nice little uh apis and utilities for doing daytime related things now stuff is the hardest right um any questions I'll pause there I think uh one question came up like Patrick it's like a third party modules don't get bundled if you have uh if you have TS config.js file in your root is it something like how that's one question that came up about I'm not aware of like what's the DS config.js f it yeah so um so typescript is uh I haven't really talked about typescript too much but typescript is of course a um popular language and compiler for writing typed JavaScript uh you can use it with the nsdk um it requires kind of some setup out of the box and that setup can be kind of nuanced um this is a question that I have heard once before which is like hey like you know it's there seems to be some like finickiness to like actually getting typescript to to play nicely with uh um with the service now SDK basically the way that it ends up getting set up is that you'd use typescript kind of in front of the SDK so first you'd use typescript to turn your Java turn your typescript files into JavaScript files and then and you'd use the typescript compiler for that which you have to like set up basically on your own as part of your project and then you'd use the service now SDK to take that outputed JavaScript and send it to the instance um that's something that we can um certainly dig into I think that something we're probably missing here is a good like example um of like typescript actually hooked up and wired up end to end published somewhere like GitHub so that people can like reference it as like here's here's kind of a a configuration of typescript that is fully functional with an ndk that's something that we can maybe dig into offline and and I'll follow up on that in in the in the comments um after the call I see another good question which is um if documentation doesn't answer a question yet or if it hasn't just been flushed out is there a place where questions can be asked by customers about this new product um I I think uh the the service now Community is probably a really great place to start that's right answer it was a trick question yeah so the service candy. servicenow.com is the hub for not only just things like our developer blog but also for getting help from external peers as well as internal peers so I highly encourage anyone that has extra extraneous questions to post them there yeah um absolutely you can of course always um reach out to to me if you'd like to I'm Patrick Wilson on LinkedIn I'm the only Patrick Wilson at at service now that I can tell so if you type Patrick Wilson service now you'll you'll find me and uh love to connect and hear about you know how other people are are using this stuff of course too so that's another place that you could you could reach out to as you can reach out to me at least until such a time where hopefully this is so popular that I just can't field all the messages in like you might regret putting that really and Patrick that was like uh that was great like I have a personal question about it like what's coming in future like anything that you like to share about it and I'm going to put a safe our Banner while you talk okay yeah for sure so um I won't say anything kind of about like specific timelines or specific release delivery vehicles or uh for anything like that um we're working on a lot of really exciting stuff like we kind of see this as the start of like the service now SDK so this is like you know this is this is V1 right this is like day one of the SDK and there's a lot of things that we want to do with this in taking it forward a few of the ideas that we have um that we're kind of in various stag of working through is something I was talking about earlier which is this notion that um you know i' I'd like to be able to Define more than just script locally like I'd like to also be able to have a mechanism for defining uh the service now content that that I Define as part of my app ideally without even leaving VSS code like an incode way of being able to do those things that's something that we're interested in we're also interested in and I expand ing our support of the node.js ecosystem that's something that we're really interested in so um you know I want to kind of as part of this answer give a few caveats to our thirdparty library support that we have right now um we are always trying to increase the compatibility of our scripting layer in service now with what you'd find in nodejs we're not at 100% compatibility yet there are things that are missing and it for those things that are missing that third party libraries depend on it means that those libraries won't work in a Sur now context um the big ones are any node.js uh Native apis so for a good example of this is like the file system API or the HTTP API these are things that are natively available in node.js so sometimes libraries depend on them we don't have them available in our scripting runtime yet um so you won't any Library that's using those things it it it won't work like we don't um we try and polyfill as much as we can but something that you know we're in oh and and another example of that is like asynchronous JavaScript support So promises asyn weight um these kind of like asynchronous features we don't have support for those yet in the uh in the service now engine so in terms of what's coming in the future we'd like to expand that right like the more types of of these apis and runtime capabilities we can support in the scripting engine uh the more thirdparty libraries that we can support as a result so that's something that you know what what I'm hoping is that we'll see kind of a a convergence story like um between our runtime and runtimes that you'd be used to using out there in the well so um those are a couple of things specific to the SDK that um that are um that we're thinking about I also see one final question that says it's a very interesting one so I kind of want to hear the group's opinion on this you know this is really exciting to see such a pro code feature get such amount of like Spotlight and funding and obviously like this is like a big part of the Washington release and they're asking how does this this mesh with service now's recent focus on low and no code yeah and so I I I I think I want to take a little bit of stab at it because pronav and I work in the marketing department right and so we see um I think that a lot of the push for low and no code isn't necessarily that service now hasn't been working on proc code it's more so that that was a that that received a probably an unfair amount of the marketing right these are features that especially in the tech ecosystem are extremely hot people are wanting to expand and diversify who can call themsel a developer and so I think that naturally a lot of them the the spotlight goes those features to make sure people know that they exist right um so I think that internally from a product management standpoint though each pillar kind of stands independently and equally of low no and then Pro would you agree with that Patrick or is that like totally off Bas no I would I mean you know um of course like service now invests quite a lot and very heavily in the the low code and the no code tools and I and I think they're really great like I've worked on them in the past like in a past life at service now I've worked on UI Builder on service portal on like all sorts of things that are low code to no code tools um you know when I think about kind of the proc code side of the story when I look at service now I feel like I've always seen like you know a development platform like I've always been able to write code and service now right like kind of to your point like that's something that's always been possible every time I go to knowledge or meet customers meet developers most of them are probably writing at least some code some of them are writing a lot of code some of the people on this call have probably written a lot of code that are listening in um so I see this as like like I don't see this as like a new like oh like we're pushing into a new space now like really what I see is like we're giving um better tooling and better support to the people who are doing the stuff that they've been doing on the service now platform since like 2003 um so that's kind of how I think about it so I totally agree with you Lauren oh yeah I'm glad I'm not totally I think no I was just saying one thing about it like I talk to a lot of pro developers who are not part of service now ecosystem they are doing things outside of service now system and this particular sgk when I talk to my friends now they say like yeah we are doing this for years now as Patrick mentioned and Lauren you also mentioned about it like so this will reduce the gap for those Pro developers to come on service now and build stuff because they don't have to learn everything from scratch now business rules all these things they can use the same knowledge that they have for the way they are developing things using load JS or different JavaScript libraries and use that knowledge and create apps on service now so it's about like for them to come up and try the platform yeah totally agree that's something I'm excited to see is like um you know I want to I I I want to open up the service now platform as a development Target for for more types of people the types of people who have been writing JavaScript for other ecosystems and they want to bring some of that to our platform that's on that's something I'm particularly excited about so I don't see it as like a it's not an either or thing in my mind like I think like I'd like to execute really well on all of it that's what I think service now should do and they're different teams too frankly so it's not like you're robbing Peter to pay Paul they're all different teams working on these products so it's not like you're diverting the attention of one of a singular team to work on one or the other so that's that's kind of nice to know absolutely and there's a lot of really cool stuff coming out in like the low code and no code space of course as well so um yeah this is an area where um you know I think we I think it all coalesces you know in um in one strategy well we're so happy to have you on this call like what you showed us was so it was it was great not not to Discount the podcast because the podcast was really really interesting to learn about the history and the trajectory of the product but being able to see it in action is definitely something really really spectacular so thank you for following up and doing an additional piece of cont content for us um it really means a lot Patrick uh do you have any final words or anything where people can come find you if they have questions or if you'd like feedback yeah you can you can you can find me on LinkedIn um you can if you'd like to you could shoot me an email patrick. Wilson Serv now.com again I'm the only Patrick Wilson at service now so you'll get me um no I'm excited to you know we're going to keep working on this stuff I'm excited to maybe come back on the show at some point and show some new stuff do you have any knowledge content perhaps that could be plugged or is that still under wraps until a little bit later I'm not I'm not sure what I am and I'm not allowed to say about that fair fair tune in like April is you know whenever you know April May is when those there's talks of Creator con stuff so um I'm not totally sure I think they're still working out a bunch of stuff like behind the scenes on that but I've heard Rumblings of Creator con stuff so maybe like you know when the schedule comes out check out the con schedule and you know you might you might see some nasty kiss stuff there perfect and everyone give a huge round of applause to all the switching and C work that PR has been doing this whole time and highlighting all the comments and stuff like that so huge round of applause to him as well um thank you all for joining us here today I want to also remind you that you know while the SDK is probably one of the number one features of the whole release there's a lot of other cool stuff too we've got more uh YouTube live streams so you can either go to our YouTube channel and click notify on the ones that you would like a notification for or you can just go to our larger content calendar at devlink dosn Washington or Washington DC both work gentlemen it's been a pleasure talking with you this morning I will give you a two minutes back where I guess one minute back for your day and hope you all have a fantastic rest of your week awesome thank you so much bye everybody bye thanks everyone [Music] all [Music] oh

View original source

https://www.youtube.com/watch?v=7UWC4Pc5Q3E