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 / 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:
I have the same question (0)
  • 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

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard