Skip to content
IT Canvass
ServiceNow References · Lesson

GlideAjax API

Quick answer

GlideAjax lets a client script call a server-side Script Include (extending AbstractAjaxProcessor).

Key takeaways

  • Client side
  • Server side (Script Include)

GlideAjax lets a client script call a server-side Script Include (extending AbstractAjaxProcessor).

Client side

var ga = new GlideAjax('MyUtils');
ga.addParam('sysparm_name', 'getManager');
ga.addParam('sysparm_user', g_form.getValue('caller_id'));
ga.getXMLAnswer(function (answer) {
  g_form.setValue('u_manager', answer);
});

Server side (Script Include)

var MyUtils = Class.create();
MyUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  getManager: function () {
    return 'sys_id_here';
  },
  type: 'MyUtils'
});

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. GlideAjax calls what on the server?

    • A. A Script Include
    • B. A business rule
    • C. A UI policy
    Show answer

    A. A Script Include

    It invokes a Script Include method.

  2. What must the Script Include extend?

    • A. AbstractAjaxProcessor
    • B. GlideRecord
    • C. GlideForm
    Show answer

    A. AbstractAjaxProcessor

    Client-callable includes extend AbstractAjaxProcessor.

Frequently asked questions

What does the term GlideAjax API refer to in ServiceNow?

GlideAjax lets a client script call a server-side Script Include (extending AbstractAjaxProcessor).
CallWhatsAppEnquire