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

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Action script for list context menus

# Action script for list context menus {#ariaid-title1}

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

The Action script field, on the Context Menu form, defines a
script. The script runs when someone selects the context menu option.
This script is client-side and runs in the user's browser. The following JavaScript
variables are available to the Action script when it is executed.  
{#r_ActionScript__table_efr_rmr_sr__entry__2}

| Variable | Description |
|-|-|
| g_list | GlideList2 against which the script runs. |
| g_fieldName | Name of the field against which the context menu runs. |
| g_fieldLabel | Label of the field against which the context menu runs. |
| g_sysId | The sys_id of the row or form against which the script runs. |
[Table 1. Action script variables]

{#r_ActionScript__table_efr_rmr_sr}  
The base system uses the following code in an action script to refresh the platform view.

    g_list.refresh(1);

Another example is the use of these variables in a list header menu to sort a list by the selected field in descending order (z to a).

    g_list.sortDescending(g_fieldName);


