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 / Count Rows in Gallery
Power Apps
Answered

Count Rows in Gallery

(0) ShareShare
ReportReport
Posted on by 11

I have a text box to show the number of items in a gallery and I used the formula Text(CountRows(Gallery.AllItems)). The problem is that the value in the text box does not update. I have refreshed my dataset multiple times but it is not changing. What might be wrong?  

 

Thanks.

Categories:
  • Verified answer
    Marshal_Jerome Profile Picture
    88 on at

    Hi @Natido 

    To show the value in the Text Input you need to reset the text input and change the default property of the text input.

    The below example counts all items in a gallery and display the total count in text box.

     

    1. Count all items and store it in a variable and reset your text input

            Set(TotalCount,CountRows(Gallery2.AllItems));
           Reset(TextInput1);

    2. On Defaut property of the text input paste the below code

          TotalCount

     

  • Gus81live Profile Picture
    71 on at

    If your datsource is updated, should work with just: 

    CountRows(Gallery2.AllItems)

     

    Try setting a temporary button with onselect:

    refresh(Gallery)

    To try it out.

  • Marshal_Jerome Profile Picture
    88 on at

    @Natido 

    Please accept the solution if the suggested solution is working.

  • Natido Profile Picture
    11 on at

    @Marshal_Jerome your solution works but I did not get exactly what I needed. With power apps, it looks like you will not get the actual count once the gallery exceeds a 100 rows  I found this post by Matthew Devaney that gave more insight: https://www.matthewdevaney.com/count-the-rows-in-a-power-apps-gallery-with-allitemscount/

     

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard