How to see the real number of records in a Salesforce list view
The Record count for Salesforce template replaces "50+ items" with the real number of records in a Lightning list view, counted through Salesforce's UI API.
Asked for since 2018Salesforce IdeaExchange ("Display total # of records in lightning list view when 50+ records displayed"), opened , 16,460 points from 1,646 votes.
Once a Lightning list view has more records than its first page, it stops counting: the line under the title says “50+ items”. To know whether that is 51 or 5,000, you scroll to the end or build a report. The Record count for Salesforce template counts the list and writes the real number in place of “50+”, in your own browser.
Steps
- In Skins Studio, open Explore, pick Record count for Salesforce and click Create App.
- Open a list view in Lightning that shows “50+ items”. Open the Skins side panel from the browser toolbar. The skin is listed under On this page.
- Switch it on. “50+ items” shows a moment of counting, then the real number, such as “122 items”.
- Refresh the list, or open another list view, and it counts again.
What you get
- The real number of records in place of “50+ items”, on every list view.
- A count made when the list opens and each time you refresh it.
- Salesforce’s own line, “122 items • Sorted by Name • …”, with only the number changed.
Limits
- It counts the records you can see. Sharing rules apply, as they do to the list itself.
- It counts 2,000 records per request, so a list of 20,000 records takes ten requests and a moment longer.
- The count is for your browser: colleagues who don’t use the skin still see “50+”.
For developers
The skin counts through Salesforce’s UI API, as you, 2,000 records per request (the most the API returns per page), asking only for record Ids: GET /services/data/v62.0/ui-api/list-records/Lead/AllOpenLeads?pageSize=2000&fields=Lead.Id. It follows nextPageToken until there is none and adds up the pages, so a list of 122 records takes one request and a list of 20,000 takes ten. One trap: the count field in the response is the number of records in that page, not the list’s total. Ask for pageSize=50 and it says 50, even when the list has 122. The 50 in “50+ items” is a different number again: it is how many rows Lightning itself loads at a time.
Other options
- Scroll to the end: Lightning loads the list 50 rows at a time, and its count goes up as you scroll.
- Reports: a report on the same filters shows the record count.
- List view charts: the chart button next to the list can show a count by a field.
- Ask Salesforce: upvote the idea. Its status is Open.