Script to get the default columns available in list view.

Gouthami Vootla
ServiceNow Employee
ServiceNow Employee

Hi Everyone, is there any script available to get the columns, which are visible under the default list view of any table, which field decides what columns need to display in the list view? like I want to verify "number" column is visible in the default view of the incident table through the script.

1 ACCEPTED SOLUTION

Ahmmed Ali
Mega Sage

Hello @Gouthami Vootla 

 

The table UI Views (sys_ui_view) contains form and list view definitions and it has related lists which contains table definition for each view and their fields.

 

Open Default view with empty name and in "lists" related list you can find incident able and in that record you will have the related list with list of fields in the incident list default view fields.

 

AhmmedAli_0-1680589768758.png

AhmmedAli_1-1680589814144.png

 

You can write script to query these tables and get the field names.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

1 REPLY 1

Ahmmed Ali
Mega Sage

Hello @Gouthami Vootla 

 

The table UI Views (sys_ui_view) contains form and list view definitions and it has related lists which contains table definition for each view and their fields.

 

Open Default view with empty name and in "lists" related list you can find incident able and in that record you will have the related list with list of fields in the incident list default view fields.

 

AhmmedAli_0-1680589768758.png

AhmmedAli_1-1680589814144.png

 

You can write script to query these tables and get the field names.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali