---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Advanced list control with scripts

# Advanced list control with scripts {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

You can write scripts to specify which list elements, such as links, filters, and
buttons, are present.

These scripts can react to the record that is being displayed. For related list controls, the
global variable parent identifies the parent record. For primary lists,
there is no parent record.  
[Configure](https://servicenow-prod.fluidtopics.net/1phGIP6~lfwMUKKczOxN0Q#configure-form-layout "Administrators or users with the personalize_form role can configure the form and related list layout.") the List Control form and add the script field that you need:

* Omit Columns Condition: If there are no conditions, omit column headings.
* Omit Edit Condition: Omit the Edit button.
* Omit Empty Condition: If there are no conditions, omit the list header.
* Omit Filter Condition: Omit the list filter.
* Omit Links Condition: Omit related links.
* Omit New Condition: Omit the New button.
{#c_AdvancedListControlWithScripts__ul_qhs_4pr_z4}  
In these script fields, if the script evaluates to true, the item is omitted. The following script is an example that you can use on the Affected CIs related list to show only the Edit button if the parent task is active. This script is placed in the Omit Edit Condition script field.

    var answer;
     if (parent.active == true ) {
     //Do not remove the 'Edit' button
      answer = false; 
    } 
    else {
     //Remove the 'Edit' button
      answer = true;
    }
    answer;

## Configure a list UI action {#ariaid-title2}

You can create a UI action that opens the slushbucket interface to customize lists in
the list view.

### Before you begin

Role required: ui_action_admin

### Procedure

1. Navigate to AllSystem DefinitionUI Actions.
2. Click New.
3. In the Table field, select the List \[sys_ui_list\] table.
4. Select the List context menu check box.
5. Ensure the Active check box is selected.
6. Paste the following script in the Script field:  

       var url  = "slushbucket.do?sysparm_form=list&sysparm_list=" + current. name + "&sysparm_view=" + current. view. name ;
       url  += "&sysparm_collection=" + current. parent + "&sysparm_collection_relationship=" + current. relationship ; 
       url  += "&sysparm_referring_url=sys_ui_view.do?sys_id=" + current. view. toString ( ) ;
       action. setRedirectURL (url ) ;

7. Click Submit.

*[\>]: and then


