Skip to content
IT Canvass
ServiceNow Cheat Sheets · Lesson

Scripting cheat sheet

Quick answer

Know where your code runs and which objects are available.

Key takeaways

  • Server side
  • Client side
  • Rule of thumb

Know where your code runs and which objects are available.

Server side

  • gs, logging, user, utilities.
  • GlideRecord, database access.
  • current / previous, in business rules.

Client side

  • g_form, read/write fields on the form.
  • g_user, current user info.
  • GlideAjax, call the server.

Rule of thumb

Security and data integrity belong on the server. The client is only for UX.

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 object edits fields on a form?

    • A. g_form
    • B. gs
    • C. current
    Show answer

    A. g_form

    g_form is the client form API.

  2. Where does data integrity belong?

    • A. On the server
    • B. On the client
    • C. In the browser cache
    Show answer

    A. On the server

    Never trust the client for integrity or security.

Frequently asked questions

What does the term Scripting cheat sheet refer to in ServiceNow?

Know where your code runs and which objects are available.
CallWhatsAppEnquire