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

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform user interface

ft:clusterId :

    - platux

bundleId :

    - platux

workflow :

    - Platform


---

# Widget API reference

# Widget API reference {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](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](https://www.servicenow.com/docs/access?context=spAriaUtil-API&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | Shows messages on a screen reader. |
| [spContextManager](https://www.servicenow.com/docs/access?context=spContextManagerAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | 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](https://www.servicenow.com/docs/access?context=spUtilAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | Utility methods to perform common functions in a Service Portal widget client script. |
| [spModal](https://www.servicenow.com/docs/access?context=SPModal-API&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | 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](https://www.servicenow.com/docs/access?context=c_GlideSPScriptableScopedAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | The GlideSPScriptable API provides methods to interact with data and perform record operations in Service Portal widgets. |
| [GlideSPSearchAnalytics](https://www.servicenow.com/docs/access?context=GlideSPSearchAnalyticsAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | The GlideSPSearchAnalytics API provides methods to generate search analytics from custom ServiceNow search widgets. |
| [SPScriptedFacet - Scoped](https://www.servicenow.com/docs/access?context=SPScriptedFacetScopedAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | Defines facet items, filters, or mapped queries for a facets object. |
| [SPScriptedFacetService - Scoped](https://www.servicenow.com/docs/access?context=SPScriptedFacetServiceScopedAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | Generates a multi-choice or single-choice facets object for an advanced search source. |
| [SPSEOUtilsSNC - Global](https://www.servicenow.com/docs/access?context=SPSEOUtilsSNCAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | Return human-readable URLs for a specific page, or for the current page, based on the transaction request. |
| [SPWidgetAccessControl - Global](https://www.servicenow.com/docs/access?context=SPWidgetAccessControlGlobalAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US) | 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).

