Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Alert noticed to change from CountRows To CountIf

(2) ShareShare
ReportReport
Posted on by 22
I am using the below code on the label text properties, 

CountRows(WarrantyDataGallery.AllItems) & "  of  total Records : " & CountRows(colAllWarranty)
 
The code is bringing the correct result, and it was working since years without any warning, today I noticed below warning:
 
CountRows may return a cached value. 
Use CountIf(DataSource, true) to get the latest count.

Please guide, it need to replace the code the suggested method?.
  • Suggested answer
    timl Profile Picture
    34,939 Super User 2025 Season 1 on at
    Alert noticed to change from CountRows To CountIf
    Hi MIA
     
    There's no need to change to CountIf(DataSource, true) in the scenario that you mention.
     
    This warning is designed for cases where the data source is Dataverse, CountRows is used without filtering, and the record count exceeds 50k records. Under these circumstances, Power Apps returns a cached count which may not be accurate. CountIf(DataSource, true) would be the way to achieve an accurate row count. 
     
    There are more details in the documentation here.
     
  • MIA Profile Picture
    22 on at
    Alert noticed to change from CountRows To CountIf
    Dear Mr. Mike,
     
    As I mentioned in my earlier post that where ever there was CountRows used, all the places the alert is showing. BUT it was working since years without any alert.
     
    Just to update you, I change on one of the label text :  
    Before Code was :  
    CountRows(colAllList)
     
    Changed to :
    CountIf(colAllList, true)
     
    Found, brings the same result, and Alert mark disappears.
     
    At this stage confused and looking forward to an advise, What to do?.
    change all the CountRows to CountIf
     
     
    Please guide further.
     
    Regards
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    41,027 Super User 2025 Season 1 on at
    Alert noticed to change from CountRows To CountIf
    Hi
     
    That is new to me, I haven't seen that, although I believe multiple people mentioned it.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard