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 204

Hi Guys,

 

I want to count all the items in a gallery which I have by using the following code

CountRows('Gallery1'.AllItems)

 

My gallery is dynamic so will change with the number of count rows.

Each line within my gallery has an input textbox.

 

What I want to do is that if there are a Count Row of 3 each input textbox within my gallery must have text.

 

Example 3 Rows, 3 textboxes must have text. 5 Rows, 5 textbox must have text.

 

Need an if statement something along the lines of:

If(CountRows('Gallery1'.AllItems) <> CountRows('Gallery1'.Inputtextbox),
do something,
else)

 

Is there any way to count the input textboxes to see if they are not blank.

 

Any help is greatly appreciated.

 

Thanks

Categories:
I have the same question (0)
  • MJ84 Profile Picture
    263 on at

    Hello,

     

    I'm not 100% sure on what you are trying to achieve but from what I understand if the row is showing in the gallery you just want the input text box to contain some text?.... Do you want each input box to show different text or the same?

     

    If it's the same text then you could use the below?

     

    MJ84_0-1677044120410.png

     

  • Verified answer
    christian12 Profile Picture
    204 on at

    @MJ84 

     

    All good.

     

    Figured it out

    If(CountRows('Gallery1'.AllItems) <> CountIf('Gallery1'.AllItems,Len('Input-text')>0),
    "No",
    "Yes")

     

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard