Mastering ServiceNow Scripting
eBook - ePub

Mastering ServiceNow Scripting

Andrew Kindred

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Mastering ServiceNow Scripting

Andrew Kindred

Book details
Book preview
Table of contents
Citations

About This Book

Understand the ServiceNow scripting and build an efficient customized ServiceNow instanceAbout This Book• Customize your ServiceNow instance according to your organization's needs• Learn to work with inbuilt JavaScript APIs in ServiceNow• Take your ServiceNow experience to the next level by learning to scriptWho This Book Is ForThis book is targeted toward ServiceNow administrators or anyone willing to learn inbuilt JavaScript APIs used to script and customize ServiceNow instances. Prior experience with ServiceNow is required.What You Will Learn• Customize your ServiceNow instance according to your organization's needs• Explore the ServiceNow-exposed JavaScript APIs and libraries• Discover the method for using ServiceNow scripting functions• Take your ServiceNow experience to the next level by understanding advanced scripting• Learn to build, test, and debug custom applications• Use your customized instance efficiently with the help of best practicesIn DetailIndustry giants like RedHat and NetApp have adopted ServiceNow for their operational needs, and it is evolving as the number one platform choice for IT Service management. ServiceNow provides their clients with an add-on when it comes to baseline instances, where scripting can be used to customize and improve the performance of instances. It also provides inbuilt JavaScript API for scripting and improving your JavaScript instance.This book will initially cover the basics of ServiceNow scripting and the appropriate time to script in a ServiceNow environment. Then, we dig deeper into client-side and server-side scripting using JavaScipt API. We will also cover advance concepts like on-demand functions, script actions, and best practices. Mastering ServiceNow Scripting acts as an end-to-end guide for writing, testing, and debugging scripts of ServiceNow. We cover update sets for moving customizations between ServiceNow instances, jelly scripts for making custom pages, and best practices for all types of script in ServiceNow.By the end of this book, you will have hands-on experience in scripting ServiceNow using inbuilt JavaScript API.Style and approachThe book will take a practical approach delving into different aspects of ServiceNow scripting to help you become a scripting master.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering ServiceNow Scripting an online PDF/ePUB?
Yes, you can access Mastering ServiceNow Scripting by Andrew Kindred in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Science General. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788624206
Edition
1

Building a Custom Application Using ServiceNow Scripting

In this final chapter, we will be looking at building a custom application using ServiceNow scripting. Custom applications are a great way to create functionality not included with the ServiceNow product. We will be looking at creating a custom application and using scripting as part of our application. We will also learn about end-to-end creation of a custom application before exploring how to test and deploy our new custom application.
In this chapter, we will be looking at the following topics:
  • Creating a custom application with ServiceNow scripting
  • End-to-end development
  • Testing
  • Deployment

Creating a custom application with ServiceNow scripting

The ability to build a custom application in ServiceNow makes ServiceNow such a versatile product. As ServiceNow was first released to the market as a service desk solution, developers have explored the potential of the platform, and since then it has been used in various areas of the business.
However, there are still many ways of using ServiceNow that are not included with the baseline system, and for this, we can create a custom application.
Before creating a custom application, it is worth considering whether a custom application will provide the best solution. Sometimes, we can use an existing ServiceNow application to perform the functionality we want to achieve, using it directly or slightly modifying it for our needs. If this is the case, then it is worth considering not creating a custom application and using the platform instead.
If the functionality you need would take a large modification to an existing application or simply does not exist at that point, it is advisable to create a custom application.

Creating the application

Once we create a new application, we can then start adding application files to that application. The application files we create become part of the application.
To create a new application, we can navigate to System Applications | Applications, and we will be shown the current applications that have been created on this instance. We then need to click on the New button on the far right, as shown in Figure 12.1:
Figure 12.1: Instance applications page
Once the New button has been selected, you are given a series of choices about where you would like to start from when creating your application.
We can see the options given in Figure 12.2:
Figure 12.2: Application creation options
From this set of choices, we can decide from what starting point we want to create our application. The top two choices are the most commonly used generally. Starting from scratch is exactly that, only the application is created and the new application scope. No tables or modules or access controls are made for you.
Creating a custom application guides you through creating a table, modules, and access controls. After that, it is much the same as starting from scratch.
The third option, to start from a service, is rarely used in my experience, but allows a developer to enhance a service created from the service creator and potentially overwrite it when complete.
The final option here is not available as part of the baseline system, but can be used if service management is activated. This option again is not as well used, although it allows creation from an existing process.
When selecting start from a template, we are presented with a further page, which we can see in Figure 12.3:
Figure 12.3: Application creation template option choices
From here, we can either create from a predefined template, or configure settings further to create the application.
Now the custom application has been created, we can start to add application files and build up the application.

Building the application

Once the application has been created, we can start to build up the application with application files. These are the files that, when put together, make up the application. When the application is created, an application scope is also created for the application. On the creation of the application, you will also be put into the new application scope, so it is important to be aware of this.
You will also see that your update set has changed once you create a new update set to a new default update set for the application scope you are now in. As you are in the application scope of your new application, any customizations made will be added to your new application.
To keep track of the current scope and update set, it can be useful to show the application and update set picker when developing. These two options can be set in the Developer tab of the system settings, which can be seen in the following figure:
Figure 12.4: Developer system settings showing the application and update set picker
By setting the two picker options in Figure 12.4, we are then shown the current application scope and update set at the top of the screen in the header bar. These are shown in a drop-down field, so both can easily be changed if required.
We can see here both of the picker drop-down fields that are displayed in the header bar:
Figure 12.5: Application and update set picker
These picker fields are especially helpful if you are working between update sets or in multiple scopes for your current development.
When working in multiple tabs, it can be a wise idea to refresh your browser page to ensure that the pickers are up-to-date on the tab you are working on.
Now that we have created and started to build our application, we can move on to the development of our application.

Example application

In this chapter, we will also build an example custom application to reinforce the theory that we learn. For our example, we will build an application to hold data for users' access.
First, we need to create the application. From the options we saw in Figure 12.2, we are going to select Create custom application. Once we have selected this, we are given the form shown in Figure 12.6:
Figure 12.6: Create custom application form
In this form, we need to give our application a name, which will then fill in the rest of the fields. We can change the values in the fields, but in the Scope field, the prefix will have to be the prefix for your company or developer instance.
For our example, we also want to create a table, so we...

Table of contents