
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 01:13 PM
Hello experts.
I have a magical List View which looks like this:
In my UI Action, how do I get access to the total number (82) of records in the List View? I'm not seeing a Count property on the GlideList (g_list) object. What am I missing?
I want to display a client-side confirmation message which says "Are you SURE you want to do X to all 82 records you shown below?"
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 06:35 PM
@G24 Tried and tested solution.
You can use below line
g_list.grandTotalRows
The above line will return you 82.
Result:
UI Action:
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 06:35 PM
@G24 Tried and tested solution.
You can use below line
g_list.grandTotalRows
The above line will return you 82.
Result:
UI Action:
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 06:19 AM
@jaheerhattiwale That is fantastic! Although I'm a little unclear on the difference between "totalRows" and "grandTotalRows". I was on a List View showing 10 of 15 records, and BOTH of those variables returned 15.
Also, do you know why I am not seeing those g_list properties documented here ? Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 07:31 AM
@G24 I too saw that both functions returning same number. I did not test that.
You can add below line in client script to see the g_list object in console.
console.log(g_list);
Do CTRL + Shift + i to open console and see result.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 10:03 AM
From my testing, it looks like you will see a difference when you've grouped the rows in your list.