---
sourceDocument: Zurich ServiceNow AI Platform user interface
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/platform-user-interface

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich ServiceNow AI Platform user interface

ft:clusterId :

    - platux

bundleId :

    - platux

workflow :

    - Platform


---

# Widget API reference

# Widget API reference {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Service Portal includes client and
server side APIs to use in widget client and server scripts.

## Service Portal client-side
APIs {#widget-api-reference__section_vcg_qkh_j1b}

These are Service Portal APIs that you
can use in a widget client controller.

See the API reference for detailed class and method information.  
{#widget-api-reference__table_skq_rjp_h1b__entry__2}

| Class | Description |
|-|-|
| spAriaUtil | Shows messages on a screen reader. |
| spContextManager | Makes data from a Service Portal widget available to other applications and services in a Service Portal page. For example, pass widget data to Agent Chat when it opens in a Service Portal page. |
| spUtil | Utility methods to perform common functions in a Service Portal widget client script. |
| spModal | Shows alerts, prompts, and confirmation dialogs in Service Portal widgets. The spModal class is available in Service Portal client scripts. |
[ ]

{#widget-api-reference__table_skq_rjp_h1b}  
Note:  
g_form as a global object cannot be used in a widget client controller or in a UI script.

## Service Portal server-side
APIs {#widget-api-reference__section_nhs_rkh_j1b}

These are Service Portal APIs that you
can use in a widget server script.  
{#widget-api-reference__table_sfm_vjp_h1b__entry__2}

| Class | Description |
|-|-|
| GlideSPScriptable | The GlideSPScriptable API provides methods to interact with data and perform record operations in Service Portal widgets. |
| GlideSPSearchAnalytics | The GlideSPSearchAnalytics API provides methods to generate search analytics from custom ServiceNow search widgets. |
|   | Defines facet items, filters, or mapped queries for a facets object. |
|   | Generates a multi-choice or single-choice facets object for an advanced search source. |
|   | Return human-readable URLs for a specific page, or for the current page, based on the transaction request. |
|   | Check whether a provided table is granted access to a widget to ensure that a widget is securely accessed by an intended audience. |
[ ]

{#widget-api-reference__table_sfm_vjp_h1b}

## Widget properties {#ariaid-title2}

Global variable and functions available in widget client and server scripts.

### Server script global objects {#widget-script-reference__section_p2w_p5h_j1b}

{#widget-script-reference__table_kjh_2ff_dy__entry__2}

| Property | Description |
|-|-|
| `input` | An object containing client-side properties set under `c.data`. The value is `undefined` until the client controller calls `c.server.update()`. |
| `data` | An object containing properties set during server-side execution. |
| `options` | An object containing the schema option properties. |
[ ]

{#widget-script-reference__table_kjh_2ff_dy}

### Client script global functions {#widget-script-reference__section_mkf_dgs_f1b}

{#widget-script-reference__table_hdm_g3x_hw__entry__2}

| Property | Description |
|-|-|
| `this.server.get([Object])` | Calls the server and sends custom `input`. Returns `Promise`. |
| `this.server.update()` | Calls the server and posts `this.data` to the server script. Returns `Promise`. |
| `this.server.refresh()` | Calls the server and automatically replaces the current options and data from the server response. Returns `Promise`. |
[ ]

{#widget-script-reference__table_hdm_g3x_hw}

A `promise` represents the eventual result of an asynchronous operation. For
more information on promises, see <https://promisesaplus.com/> or [AngularJS documentation](https://docs.angularjs.org/api/ng/service/$q).

