Book Image

ServiceNow Cookbook

By : Ashish Rudra Srivastava, Dustin Turner
Book Image

ServiceNow Cookbook

By: Ashish Rudra Srivastava, Dustin Turner

Overview of this book

ServiceNow is the ideal platform for you to create enterprise-level applications, giving borh requesters and fulfillers better visibility and access to a process. With this title we’ll guide you through the world of ServiceNow, letting you take on the best the platform offers you with the least amount of hassle. Starting with the core configuration and management tasks, this book will help you build data-driven apps and it will also explore development best practices. You will learn to set up email notifications for users and work with the database view for reporting. Next, the book will guide you through creating various tasks from the workflow and show you how to make the most of the workflow utilities available in ServiceNow. Finally, the book will drive you through the auditing and diagnosing aspects of ServiceNow. By the end of this book, you will acquire immediately applicable skills to rectify everyday problems encountered on the ServiceNow platform.
Table of Contents (14 chapters)
ServiceNow Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Working with background scripts


A background script is a place where you can test your server-side scripts, which is same as free text box. To access the background script, you should have a security_admin role with elevated privileges.

Getting ready

To step through this recipe, you should have an active Service-Now instance, valid credentials, and a security admin role.

How to do it...

  1. Open any standard web browser and type the instance address.

  2. On the left-hand side, type background in the search box and Service-Now will search the module for you.

  3. Click on the Scripts - Background module under System Definition application, as shown here:

    Background script module

  4. Now you will be able to see the following screen, where you can place your code and click on the Run  script button:

    Run script

  5. Service-Now has an inbuilt gs.print() function, which is used to view the output of the script and it also write an entry in a log file, but the gs.log () functions in write an entry in the system log and log file...