Using GlideRecord (and its friends)

The previous two chapters demonstrated that ServiceNow is built around data. Background scripts, and scripts in general, can use the excellent database connectivity capabilities built into ServiceNow to easily access whatever information we want. GlideRecord is instrumental in doing this.

GlideRecord is a class that lets you work with a database table. With it, you can create, read, or update records in a database. In general, you work one record at a time, iterating through a result set.

It is easy to use, but I recommend reviewing the basics from the product documentation or a scripting course. In this chapter, we'll quickly run through the basics and start to explore the gotchas as well as some very ...

Get ServiceNow: Building Powerful Workflows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.