Book Image

ServiceNow Application Development

By : Sagar Gupta
Book Image

ServiceNow Application Development

By: Sagar Gupta

Overview of this book

ServiceNow provides service management for every department in the enterprise, including IT, Human Resources, Facilities, Field Service, and more. This book focuses on all the steps required to develop apps and workflows for any of your business requirements using ServiceNow. You will start with the first module, which covers the basics of ServiceNow and how applications are structured; how you can customize the dashboard as required; and also how to create users. After you get used to the dashboard, you will move on to the next module, Applications and Tables, where you will learn about working with different tables and how you can create a scope other than the global scope for your application. The next module is Scripting and APIs, where you will learn Scripting in ServiceNow and use powerful APIs to develop applications. The final module, Administration Essentials, covers debugging, advanced database features, and scheduled script creation. By the end of the book you will have mastered creating organized and customer-friendly applications
Table of Contents (21 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Introduction to ServiceNow

Preface

ServiceNow Application Development will focus on in-depth application development from designing forms to write business rules and client scripts to designing workflows on the world’s fastest growing enterprise cloud platform. Global organizations such as GE, NASA, Intel, and Dell EMC are using the ServiceNow platform to quickly build enterprise-ready custom applications that run on the cloud. GE Capital, the financing arm of GE, delivers financial, intellectual, and human capital to its customers, around the world and to meet growing challenges they used ServiceNow to build a new cloud-ready Risk Vulnerability Assessment Tool (RVAT) in only six weeks. This developer-focused book will serve as a road map for you and your team on how to build cloud-ready applications, manage data in single system of record, build standard-based applications, and win customers' and IT users' satisfaction.

What this book covers

Chapter 1, Introduction to ServiceNow, will help the reader get started with ServiceNow and gain access to a free developer instance from ServiceNow Developer Portal. The chapter is focused on getting the reader used to the platform and the basics of ServiceNow, such as UI, Login process, and some out-of-the box applications and features. The chapter will also help the reader brush up their knowledge about how ServiceNow is used within organizations.

Chapter 2, User Administration, explains how to create new users and associate them to a group. You will also learn how to assign roles to groups and users. Further, you will learn how to impersonate a user to test if our newly created users have access to correct applications and modules.

Chapter 3, Data Management, explains that managing tables and columns is one of the most common job administrators and developers have to perform when working on the ServiceNow platform. ServiceNow platform features various modules that can be used to create and manage tables and columns. In this chapter, you will learn how to create a new table from scratch, extend existing table and add fields (or columns) to new or existing tables. You will also understand the structure of existing tables such as task and cmdb.

Chapter 4, ApplicationScopes, explains that, when developing applications on the ServiceNow platform, developers need to take special care about the application scope they are working on. Applications help administrators and developers to combine different modules and features to deliver a relevant set of functionality. ServiceNow allows developers and administrators simple means to create and manage applications. In this chapter, you will learn how to create new applications. You will learn about the relationship between applications and scopes. You will also learn how to use applications to associate relevant information and access data from other applications.

Chapter 5, Modules, Forms, and Views, explains that ServiceNow platform easy-to-use features that allow administrators to create modules, and customize form and views. In this chapter, you will learn how to create different type of modules, customize the form layout, and quickly add new form fields to the table. You will also learn about various form field element types available in the platform including the reference field, journal field, date field and choice list. Furthermore, you will learn how to use form views to present same record in different manner to end-users based on their role.

Chapter 6, Introduction to ServiceNow Scripting, ServiceNow platform offers various scripting options to developers. This chapter, you will learn about different type of scripting options available in ServiceNow platform. You will learn about difference between server-side and client-side scripts. Furthermore, you will also learn how scripting works in scoped applications and get introduced to client-side and server-sideGlide APIs.

Chapter 7, Client-Side Scripting, will help you to learn how to create client-side scripts and what are the different ways to execute the client-side code. The readers will learn how to make use of the client-side Glide API and some of the most widely used functions available. You will learn how to create client scripts, UI policy, and UI script.

Chapter 8, Server-side Scripting, explains that server-side scripts and APIs can be employed to enhance server-side data processing and integration with different systems. Server-side scripts can also be used to perform database operations and perform large scripted imports. This chapter will help you learn how to create server-side scripts, and when and where the server side scripts comes in the scene when working with ServiceNow applications. The chapter will help you understand how to make use of the server-side Glide API and server-side artifacts like Business Rules, script-include, and data policy.

Chapter 9, Jelly Scripting, explains that in ServiceNow platform, Apache’s Jelly syntax is used to render forms and UI pages. Jelly is Java and XML-based scripting and a transformation engine used to turn XML into executable code. The output is usually HTML and JavaScript code that is used by the browser to render elements on a page. This chapter will help you learn how to create UI pages, UI macros and formatters. You will learn how to make use of Jelly scripts to enhance our UIs and create custom controls and application property page.

Chapter 10, Events and Notifications, explains that in ServiceNow, Events are used to monitor changes or events by event handlers just like in any other programming language. Events in the queue are consumed by script actions or notifications, which in turn execute scripts or trigger notifications. Notification on the other hand, is an approach to send out e-mail to the end-users or external end-points. Any form or script sending out an email relies on the Notification feature of the platform. This chapter will help you learn how to trigger events when data changes and send out e-mail based on events.

Chapter 11, Workflow Development, explains that the ServiceNow offers a web based visual workflow designer known as Workflow Editor. A workflow is made up of activities and always consists of begin and end activities that marks the start and end of the workflow. This chapter will help you learn how to use many of the different available standard workflow activities including the REST activity and how to design, run and test your own workflow.

Chapter 12, Debugging in ServiceNow, explains that within ServiceNow you write both server-side and client-side code. The ways to troubleshoot them more or less remain same but the approach differs. This chapter will cover many different troubleshooting and debugging techniques available within the platform. The chapter will help you how to use many features to debug and troubleshoot scripts in ServiceNow platform and cover various topics such as Syntax editor, launching and using the Script debugger, JavaScript log and Field watcher.

Chapter 13, Advanced Database Features, ServiceNow platform offers many features to improve the performance and overall functionalities of ServiceNow applications. This chapter will cover features like relationships, indexing, full-text search, and overriding field properties. You will also learn features such as enabling auditing, restoring deleted records and Table rotation and data archiving.

Chapter 14, Job Scheduling and Data Export-Import, explains that as a developer you will always to be tasked to ensure data from various external systems can be brought into the platform with ease and this may require you to create scripted controls that can perform pre- and post-processing of the imported data. This chapter includes some of advanced development and administrative tasks that a developer must be aware of like scheduled script execution (SSE), and data export and import. More specifically, you will help how to schedule a script to run in the background, export data, import data using import sets, configure transform maps and use scripts to process imported data.

What you need for this book

As ServiceNow is a cloud-based SaaS application, it can be accessed using most standard browsers. These are browsers that are supported by the UI16 of the ServiceNow application:

  • Chrome Version: Latest public release
  • Firefox Version: Latest public release
  • Internet Explorer Version: 9 and above
  • Microsoft Edge Version: Latest public release
  • Apple Safari Version: 9.1 and above

There are some limitations when using Internet Explorer to access ServiceNow, including the following:

  • Compatibility mode is not supported
  • Setting security to High using Internet Options | Security tab is not supported and will make some ServiceNow applications and features inaccessible
  • Internet Explorer 11 may face memory leak issues especially in Windows 7

Notifications in Connect are only available in Safari, Chrome and Firefox. Internet Explorer doesn’t support notification feature.

Note

Cookies must be enabled for the login feature to work. If you disable cookies, you will not be able to log in to the instance.

Who this book is for

This book is indented for anyone who wants to learn how to develop software on the world's fastest growing enterprise cloud platform. Developers and administrator, who are already working on ServiceNow, can also use this book to brush up their knowledge of key development features.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The g_user global object can be used to retrieve user session information in client scripts."

A block of code is set as follows:

function DemoCallBack(response) { 
//javascript code 
var answer = response.responseXML.documentElement.getAttribute("answer");  
console.log(answer); 
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Navigate to the bottom of the page and click on the New button in the Database Indexes related list."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

 

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.