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 / Counting Records SQL
Power Apps
Answered

Counting Records SQL

(0) ShareShare
ReportReport
Posted on by 353

Hello,

 

I want to filter my SQL DB to grab records, i want to display the count of records. But the records count goes over 2,000. So even in SQL there is this issue with loading data or grabbing. How can get i the full count of my filtered list ? 

 

Thanks

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    Using a stored procedure you should be able to calculate the count on the SQL server and return the record count to PowerApps.  That will work even if there are more than 2,000 records in the count since the records themselves are not returned.  What you won't be able to do is select more than 2,000 records and return them with a count.  So are you just trying to get a record count or the records themselves?

  • mmattar Profile Picture
    353 on at

    Yes, i just want to be able to get a count of the records that were filtered via the query. You are saying to use a stored percedure ?

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @mmattar 

     

    If you have such a column in your table, where it holds the row count (something like an autoincrement column), in that case, you can use the expression:
     
    Last(Sort(TableName,AutoincrementColumnName,Descending)).AutoincrementColumnName
     
    If not, you can get the value using a stored procedure. For reference, please follow the tutorial: https://powerusers.microsoft.com/t5/Video-Gallery/Calling-Stored-Procedures-from-within-PowerApps/m-p/161897
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    SQL stored procedures by definition operate on the server.  So if you have a stored procedure that processes a query on the erver and returns a count of records then it will work.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard