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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 361

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard