Skip to Main Content
Mastering ServiceNow Scripting
book

Mastering ServiceNow Scripting

by Andrew Kindred
February 2018
Intermediate to advanced content levelIntermediate to advanced
226 pages
5h 13m
English
Packt Publishing
Content preview from Mastering ServiceNow Scripting

GlideRecord

One of the most common JavaScript APIs is the GlideRecord class, which is extremely handy and will fast become a staple of most scripting. GlideRecord is a way of finding and counting records in ServiceNow based on many different queries. It is quite similar to a SQL statement if that is something you are familiar with.

Let's have a look at how to use GlideRecord.

We'll take a look at how to query all the records in a particular table. The format of the GlideRecord script for this is shown in the following, with table_name being the only parameter. This needs to be the table name rather than the table label:

new GlideRecord('<table_name>');

We will set a variable to hold the GlideRecord object and define the table that will be ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PowerShell Cookbook, 4th Edition

PowerShell Cookbook, 4th Edition

Lee Holmes
Learning Splunk

Learning Splunk

Tom Kopchak

Publisher Resources

ISBN: 9781788627092Supplemental Content