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 / Nested Gallery filter ...
Power Apps
Unanswered

Nested Gallery filter by variable table

(0) ShareShare
ReportReport
Posted on by 131

Hi I want to filter a nested gallery (lets call it "Sub_Gallery" by the variable "SelCode".

I have a Gallery of items "DivRecords" as below:

simondpalmer_1-1648672360301.png

 

 

That has a nested record called "SubDivs"

simondpalmer_2-1648672405457.png

 

That I want to filter these "SubDivs" if they match the table called "SelCode" as below

simondpalmer_0-1648672324575.png

 

What I have at the moment is the following within the "Sub_Gallery":

Filter(ThisItem.Subdivs, Title in SelCode.Result)

 But it is not filtering at all. I also tried

Filter(ThisItem.Subdivs, Title in SelCode).Result

But it is not working either.

Any help would be appreciated!

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @simondpalmer 

    Try this

    Filter( ThisItem.Subdivs.Title, Title in SelCode.Result)

     

     

  • simondpalmer Profile Picture
    131 on at

    That doesn't seem to work as well. Nether does:

    Filter(ThisItem.Subdivs, Title in SelCode.Result).Title

    FYI I am showing the outcome in a Label for instance I am writing:

    ThisItem.Title

    Is there something I am missing with nested galleries or could there be a mismatch in data types between the two tables I am comparing (Both are "text" values "03 10 00" for example)?

  • EddieE Profile Picture
    4,641 Moderator on at

    @simondpalmer 

    Just so I’m sure, you have built a Gallery inside another Gallery, correct. You are not talking about a data source - eg a collection - that has a nested table inside it? The approach to accessing the latter can be quite different.

     

    If you have the former, ie 2 galleries, can you provide the Items properties of both please.

  • simondpalmer Profile Picture
    131 on at

    Yes I have "Gallery-Div" that is referring to a collection called "DivRecord". Collection looks like below

    simondpalmer_0-1648759741376.png

     

    Inside this Gallery is another Gallery called "Gallery-SubDiv" where I am trying to filter by the "Title" items inside "SubDivs".

    SubDivs looks like below:

    simondpalmer_1-1648759809812.png

     

     

  • simondpalmer Profile Picture
    131 on at

    Just to add for completeness These items are being filtered if the "Title" is found in the "SelCode" Result items.

    simondpalmer_2-1648760208807.png

     

     Hope that helps. Is it because the values have spaces? The numbers where from an excel table converted to a sharepoint list as a single line of text. If that helps

  • EddieE Profile Picture
    4,641 Moderator on at

    @simondpalmer 

    It's possible that there's a data type mismatch going on. Can you explain your data sources please.

     

    How / where is DivRecord created / from, and the same for SelCode. Are these both SharePoint lists for example?

     

    You could try pulling SelCode into a collection and us that in my previous code and see if that works, ie

    ClearCollect( colSelCode, SelCode) // Note: change the 2nd parameter 'SelCode' to the actual name of your data source

    ... then

    Filter( ThisItem.Subdivs.Title, Title in colSelCode.Result) // assuming here that 'Result' is a column/field in your datasource

     

     

  • simondpalmer Profile Picture
    131 on at

    Thanks for the suggestion but it still doesn't work even with SelCode as a collection. All data is from Sharepoint Lists originally but are now Collections. I even just tried to do the filtering outside of the 2 galleries with

    ClearCollect(DivRefined, Filter(DivRecord.Subdivs, "Title" in SelCode.Result))

      But that doesn't work either... I am stumped

  • EddieE Profile Picture
    4,641 Moderator on at

    What column type is Subdivs. Also, can you explain ' .. that doesn't work...' to me. Are you getting an error (if so, can you provide a screenshot and desc) or is there no error but nothing happens or something else?

  • simondpalmer Profile Picture
    131 on at

    "that doesn't work" meant that the collection is created with the column called SubDivs but no information:

    simondpalmer_0-1648763074077.png

     

  • EddieE Profile Picture
    4,641 Moderator on at

    Ok, thanks.

     

    How are your collections created, ie what code is used? Also, what field type is SubDivs in SharePoint ge LookUp, Choice, other

     

    For reference, I have a List with a Single Line of Text column and a Multi Choice LookUp column. I use a simple ClearCollect to pull these into PowerApps, ie

     

    ClearCollect( 
     col,
     ShowColumns(myList, "TextColName", "MultiLookUpName")
    );

    I then re-create a collection similar to your SelCode, ie

    ClearCollect(
     SelCode,
     {Result: "Value1"},
     {Result: "Value2"}
    );

     

    I then added a Gallery with,
    Items property = 'col', and a

    single label Text property = ThisItem.TextColName

     

    Inside this gallery I added another gallery with

    Items property = Filter( ThisItem.MultiLookUpName.Value, Value in SelCode.Result), and a

    Single label Text property = ThisItem.Value

     

    All the above works correctly. Items displayed in the inner gallery are only those values that appear in SelCode. Maybe this can give you some tips on where to look / setup your solution?

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard