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:
  • 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

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard