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 / Counting visible items...
Power Apps
Answered

Counting visible items in a gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a couple of galleries...I want an end gallery to only show items that are in both other galleries. So like only customers that are in both galleries show in the third gallery. I have that part woking...I used a flexible height and set the Visible property on the line true if in both galleries. 

 

What i now need is to process only those showing in my third gallery...how can (or can I) process through the visible lines? Can I count the visible lines? I was hoping to use the visible lines to collect them and then use them for a next step...without having to manually select them to add them to a collection.

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Misread request, 

    ]

     

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Ok so while I did misread the original, my answer is probably a better way to do what you want anyways so still going to share it

     

    so in my first test gallery i have 

    [{Title:1, Other:"One"}, {Title:3, Other:"Three"}, {Title:4, Other:"Four"}, {Title:5, Other:"Five"}]

     

    in my second 

    [{Title:2, Other:"Two"}, {Title:3, Other:"Three"}, {Title:4, Other:"Four"}, {Title:6, Other:"Six"}]

     

    and in my third

    Filter(ForAll(Gallery1.AllItems As galleryOne, If(galleryOne.Title in Gallery2.AllItems.Title, galleryOne)), !IsBlank(ThisRecord))

     

    So only the records that title is in both previous galleries is ever brought into this third gallery at all. Much better than just hiding it when it comes to processing records alter.

     

    TheRobRush_0-1692045359131.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    thanks! that works.  I wouldn't have thought of doing that...was thinking of using a collection...which I guess technically it is in a way. 🙂

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I did have to put '.Value' on the end of ThisRecord or it counted blank lines...but that was an easy find. Thanks again!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    weird, in the formula provided it only adds a record record to the gallery if it matched both, if it doesnt it should be providing a blank records which should be filtered out as is. Tested with a label and 

    Gallery3.AllItemsCount

    on my side to verify, maybe just different when using datasources vs hardcoded item properties not sure

  • TheRobRush Profile Picture
    11,128 Moderator on at

    No, weird, changed it in my example to sharepoint list in first, 

    Filter(MainEntryRoster, StartsWith(Title, "G"))

    in second and same in third as before and 

    Gallery3.AllItemsCount

    only counts the 16 items as expected. Curious where the issue in yours was, maybe slight change on your side to the third gallery code?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I figured out what I did...I put the actual column I wanted and not the gallery item...

    Filter(ForAll(Gallery7.AllItems As galleryOne, If(galleryOne.CustID in Gallery7_1.AllItems.CustID, galleryOne.CustID)),!IsBlank(ThisRecord.Value))

    instead of

    Filter(ForAll(Gallery7.AllItems As galleryOne, If(galleryOne.CustID in Gallery7_1.AllItems.CustID, galleryOne)),!IsBlank(ThisRecord))

    the first only returned the one column I needed, but gave blanks otherwise that then had to be filtered by adding the .Value on the end. I fixed it and now works.

     

    Would I be able to structure my next step the same if I have a similar set of galleries with data grouped by a column? Would it be a ForAll inside a ForAll?

  • TheRobRush Profile Picture
    11,128 Moderator on at

    I would probably filter the gallery, then ungroup so as to only need one forall personally.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard