Skip to content
IT Canvass
ServiceNow References · Lesson

GlideRecord API

Quick answer

GlideRecord is the server-side database API.

Key takeaways

  • Query
  • Read & write

GlideRecord is the server-side database API.

Query

  • addQuery(field, value), add a condition.
  • addActiveQuery(), active = true.
  • addEncodedQuery(str), a full encoded query.
  • orderBy(field) / setLimit(n)
  • query() then next()

Read & write

  • getValue(field) / setValue(field, val)
  • insert() / update() / deleteRecord()
  • get(sys_id), fetch one record.
  • getRowCount()

Want to learn this properly?

Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. Which method adds a full encoded query string?

    • A. addEncodedQuery()
    • B. addQuery()
    • C. orderBy()
    Show answer

    A. addEncodedQuery()

    addEncodedQuery accepts an encoded query.

  2. Which caps the number of returned rows?

    • A. setLimit()
    • B. getRowCount()
    • C. next()
    Show answer

    A. setLimit()

    setLimit(n) limits results.

Frequently asked questions

What does the term GlideRecord API refer to in ServiceNow?

GlideRecord is the server-side database API.
CallWhatsAppEnquire