Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Count Rows in Gallery

(0) ShareShare
ReportReport
Posted on by 178

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

  • Verified answer
    christian12 Profile Picture
    christian12 178 on at
    Re: Count Rows in Gallery

    @MJ84 

     

    All good.

     

    Figured it out

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

     

     

     

     

  • MJ84 Profile Picture
    MJ84 263 on at
    Re: Count Rows in Gallery

    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

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard