web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / totalResultCount retur...
Power Apps
Unanswered

totalResultCount returning -1

(0) ShareShare
ReportReport
Posted on by 482

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/paging

totalResultCount is returning -1 when the total is greater than 5000. I'm guessing this is by design, but couldn't see a comment in the documentation. Thought I would mention and confirm here just in case I'm doing something wrong. Anyone else seen this behaviour?

I have the same question (0)
  • aroudaki Profile Picture
    Microsoft Employee on at

    Yes, its by design since the server doesn't return total count when there are more than 5000 records

  • skoofy5 Profile Picture
    482 on at

    Thanks for the confirmation. Would be great for documentation to mention this for others.

  • shadowfox Profile Picture
    41 on at

    This didn't use to work that way - not sure when it changed. Did you figure out a work around for this @skoofy5 ?

  • skoofy5 Profile Picture
    482 on at

    The only workaround you have is to manage the return of -1 and have your control understand it.

     

    The API only returns a maximum of 5000 records, so it makes sense that it cannot return a definitive count for anything over that and it also make sense that it can't return a number of >5000 (because that would be a string at that point). You could do an aggregate call to try and count the records, but it would need to match any filtering you might do as well as have the new limitation of 50,000 records. Given that I just opted to show -1 as 5000+ when I had a pageSize greater than 0 and totalResultCount equals -1. Hope that helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard