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

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia ServiceNow AI Platform user interface

ft:clusterId :

    - platux

bundleId :

    - platux

workflow :

    - Platform


---

# Supported client script types and APIs

# Supported client script types and APIs {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Supported client script types and APIs

This document outlines the compatibility and usage of client scripts and client-side APIs within the ServiceNow Service Portal environment as of the Australia release.
It highlights which script types are supported, important UI type settings, and limitations to consider when developing or migrating client scripts to Service Portal.
Show full answer Show less  

## Supported Client Script Types in Service Portal

* **Catalog Client Scripts:** Must have the UI Type set to *All* or *Mobile / Service Portal* . Scripts marked as *Desktop* use legacy APIs and are not supported.
* **Validation Scripts:** Also require UI Type set to *All* or *Mobile / Service Portal*. They validate specific field input in Service Portal. For upgraded instances, ensure Mobile and Service Portal validation script versions are activated to enforce validation in Service Portal.
* **UI Scripts:** Must have UI Type set to *All* or *Mobile / Service Portal* . Use the `guiscripts` global object to call UI scripts within validation scripts. UI scripts should have the Global field set to false.
* **UI Actions:** All server-side UI actions are supported. However, `setRedirectURL()` calls are ignored because Service Portal handles redirection differently. Client-marked UI Actions are ignored on forms in Service Portal.
* **UI Policies:** Supported, but declarative UI Policies are recommended. Avoid scripting unless necessary.
* **Unsupported Types:** UI Macros and Formatters are not supported as they rely on Jelly scripting, which Service Portal does not support.

## Supported Client-Side APIs

Service Portal supports specific client-side APIs usable in client scripts such as onLoad, onChange, and onSubmit. Key classes include:

* **gform:** Provides methods for field manipulation, messaging, form control, and UI interactions. Notably, the `variables.varname` notation and usage of `gform` as a global object are not supported in widget client controllers or UI scripts.
* **glist:** Supports list manipulation including adding/removing items and query management.
* **gservicecatalog:** Provides methods related to order guides.
* **GlideAjax:** Supports asynchronous server calls with methods to add parameters and handle responses. Synchronous calls like `getXMLWait()` are not supported in Service Portal; asynchronous alternatives must be used. GlideAjax cannot be used in widget client controllers.
* **GlideRecord:** Allows client-side record querying, insertion, and manipulation with asynchronous query execution.
* **i18NV3:** Supports asynchronous message retrieval for localization.

## Practical Considerations for ServiceNow Customers

* When creating or migrating client scripts for Service Portal, always set the UI Type to *All* or *Mobile / Service Portal* to ensure compatibility.
* Verify that client scripts use only supported client-side APIs to avoid runtime errors in Service Portal.
* For validation scripts, activate the Mobile and Service Portal versions post-upgrade to enforce validation in the portal interface.
* Use asynchronous GlideAjax calls in Service Portal widgets and avoid synchronous methods.
* Prefer declarative UI Policies over scripted ones to align with Service Portal best practices.
* Be aware that UI Actions with client-side scripts and UI Macros or Formatters will not function in Service Portal.  
Some client scripts are not supported in Service Portal. Others must have a UI type
set to All or Mobile / Service Portal. If using a
client script in the Service Portal, only
client-side APIs supported in a mobile environment can be used.

## Client script support in Service Portal {#client-script-reference__section_z3x_slf_wbb}

{#client-script-reference__table_SPScriptSupport__entry__2}

| Client script | Description |
|-|-|
| Catalog client scripts | Service Portal requires that the UI Type field be set to All or Mobile / Service Portal. Client Scripts marked as Desktop rely on legacy APIs that are not supported in Service Portal. Before flagging a script as Mobile / Service Portal or All, make sure you are only using supported client-side APIs. |
| Validation scripts | Service Portal requires that the UI Type field be set to All or Mobile / Service Portal. Client Scripts marked as Desktop rely on legacy APIs that are not supported in Service Portal. Before flagging a script as Mobile / Service Portal or All, make sure you are only using supported client-side APIs. Validate user input in a specific field type using a validation script. In new instances, Service Portal includes XML, Script, Script (Plain), Email, and Version validation scripts by default. If upgrading from a previous release, the Mobile and Service Portal version is not active by default. You must activate the Mobile and Service Portal version of the validation script to validate user input in the Service Portal. See [Activate Service Portal validation scripts](https://www.servicenow.com/docs/BUy0uFk51TAmpZ9Ri9sdVw "Validate user input in a specific field type using a validation script. In new instances, Service Portal includes XML, Script, Script (Plain), Email, and Version validation scripts by default. If upgrading from a previous release, the Mobile and Service Portal version is not active by default. You must activate the Mobile and Service Portal version of the validation script to validate user input in the Service Portal."). Note: To call a UI script within a Validation script, use the g_ui_scripts global object. For more information, see [GlideUIScripts](https://www.servicenow.com/docs/access?context=GUIScriptsAPI&version=australia&pubname=australia-api-reference&ft:locale=en-US). Verify that the UI script has the Global field set to false and UI Type set to Mobile / Service Portal or All. |
| UI scripts | Service Portal requires that the UI Type field be set to All or Mobile / Service Portal. Client Scripts marked as Desktop rely on legacy APIs that are not supported in Service Portal. Before flagging a script as Mobile / Service Portal or All, make sure you are only using supported client-side APIs. |
| UI Actions | All server-side UI actions are supported in Service Portal, although setRedirectURL() operations are ignored because Service Portal forms handle redirection in a different way than the platform. The form widget ignores any UI Actions marked as Client. |
| UI Policies | Supported, although you should use only declarative UI Policies. Avoid scripting unless the outcome cannot be achieved through the condition builder. |
| UI Macros | Not supported as UI macros use Jelly. |
| Formatters | Not supported as formatters use Jelly. |
[ ]

{#client-script-reference__table_SPScriptSupport}

## Supported client-side APIs {#client-script-reference__section_vcg_qkh_j1b}

Supported client scripting APIs for use in onLoad, onChange, and onSubmit client
scripts.

For detailed class and method information, see the [Client API reference](https://www.servicenow.com/docs/access?context=api-client&version=australia&pubname=australia-api-reference&ft:locale=en-US).  
{#client-script-reference__table_skq_rjp_h1b__entry__2}

| Class | Available methods |
|-|-|
| g_form | * addDecoration(fieldName, icon, title) * addErrorMessage(message) * addInfoMessage(message) * addOption(fieldName, value, label, index) * clearOptions(fieldName) * getActionName() * getBooleanValue(fieldName) * getDecimalValue(fieldName) * getEncodedRecord() * getFieldNames() * getIntValue(fieldName) * getLabel(fieldName) * getReference(fieldName, callback) * getRelatedListNames() * getSectionNames() * getSysId() * getTableName() * getValue(fieldName) * hasField(fieldName) * hideAllFieldMsgs(type: "info \| error") * hideErrorBox(fieldName) * hideFieldMsg(fieldName, clearAll) * hideRelatedList(listTableName) * hideRelatedLists() * isMandatory(fieldName) * isNewRecord() * isReadOnly(fieldName) * isVisible(fieldName) * removeDecoration(fieldName, icon, title) * removeOption(fieldName, value) * save() * serialize(onlyDirtyFields) * setFieldPlaceholder(fieldName, placeholder) * setLabel(fieldName, label) * setMandatory(fieldName, isMandatory) * setReadOnly(fieldName, isReadOnly) * setSectionDisplay(sectionName, isVisible) * setValue(fieldName, value, displayValue) * setVisible(fieldName, isVisible) * showErrorBox(fieldName, message, scrollForm) * showFieldMsg(fieldName, message, type: "info \| error", scrollForm) * showRelatedList(relatedTableName) * showRelatedLists() * submit(submitActionName) {#client-script-reference__ul_ltf_pc3_hy} Note: Using the `variables.var_name` notation with the g_form API is not supported in Service Portal. g_form as a global object cannot be used in a widget client controller or in a UI script. |
| g_list | * get(fieldName) * addItem(value, displayValue) * removeItem(value) * reset() * setQuery(queryString) * setDefaultOperator(operator) * getDefaultOperator() {#client-script-reference__ul_s2j_vc3_hy} |
| g_service_catalog | isOrderGuide() |
| GlideAjax | * addParam (name, value) * getParam (name) * getXML(callback) * getXMLAnswer(callback) * getJSON(callback) * setErrorCallback(errorCallback) * getURL() * getParams() * execute() * successCalback(data, status, xhr) * errorCallback(xhr) * setScope(scope) {#client-script-reference__ul_atv_1d3_hy} Note: * Because the mobile platform does not allow synchronous GlideAjax calls, the getXMLWait() method in a GlideAjax call does not work in the Service Portal. Instead, use one of the asynchronous calls such as getXML(Function callback) or getXMLAnswer(Function callback). * GlideAjax cannot be used in a widget client controller. {#client-script-reference__ul_tsh_1f2_nsb} |
| GlideRecord | * addQuery(encodedQuery) * addQuery(fieldName, operator, value) * getEncodedQuery() * get(id) * getTableName() * hasNext() * insert(callback) * gotoTop() * next() * loadRow(rowObj) * getValue(fieldName) * setValue(fieldName, value) * isDotWalkField(fieldName) * addOrderBy(fieldName) * setDisplayFields(fieldNames) * query(callback) * setRows(rowsArray) * setTableName(tableName) * setLimit(maxInt) * getLimit() {#client-script-reference__ul_c5n_dd3_hy} |
| i18NV3 | getMessage(String messageKey, Function callback) |
[ ]

{#client-script-reference__table_skq_rjp_h1b}

