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 / Is possible to filter ...
Power Apps
Answered

Is possible to filter one gallery based on checked items in another gallery

(0) ShareShare
ReportReport
Posted on by 46

My case is this, I have one gallery acting as a filter based on a list from sharepoint showing a checkbox in each gallery item with the item name. I have another gallery with data showing using the same list I want the second gallery to filter out data show based on items checked true or false in the filter gallery list. Is this possible without patching yes/no in sharepoint? The main reason I don't want to patch a yes no on the main list is that I want to eventually have this filter ability savable per person. I found one method is to show items in the second gallery based on all items of the first gallery, the issue with this is that when scrolling the second gallery I only get loaded data from the first gallery. I need to be able to load data from the SP list in the second data without needing data loaded from the first but still have the second gallery check the first gallery to see if it should be shown. Maybe I'm going about this completely wrong. Maybe I need to set up filter profiles first on SP and then patch all checked items into a choice column and base the filter of the second column on the filter profile. Let me know if anyone has any ideas.

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nBow 

    Sure, just set the Items property of your second gallery to:

       Filter(yourFirstGallery.AllItems, theCheckboxName.Value)

     

    That's it!

     

    I hope this is helpful for you.

  • nBow Profile Picture
    46 on at

    Doesn't this only show values in the second gallery according to data loaded into the first gallery though? What I mean by this is that even delegated data only loads a max of 100 items in a gallery for performance, when you do this type of thing it has the right effect except that the second gallery can't load delegated data itself. I've been working on a filter profiles function for my app that stores a filter profile in another sharepoint list so hopefully that solution works instead. It will let people save a filter profile or use the default one. It would be cool if the dev team for PowerApps would let web developers write our own components at the code level, because this is something that can easily be done in normal web code but is limited by "performance" handling of PA. I've never had performance issues with loading data in react so I don't understand why gallery loading data is so restrictive or why filtering is so restrictive. There's many things about PA that are very restrictive for little to no reason imo. Anyway thank you for the suggestion regardless!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nBow 

    Yeah...not going to happen with PowerApps to develop like that.  PowerApps is a no-code platform!  You can extend into some custom design, but it is not what you are looking for.

     

    You are confusing delegation with paging.  A Gallery pages its data (if it can).  Delegation has to do with being able to delegate criteria for finding/identifying records to a datasource.  And to add...Record Limit in the app refers to the maximum number of records that any ONE function in PowerApps can return.

    I mention record limit because - Due to the paging in the gallery...record limit does not apply the same way.

     

    As for your scenario...how many records are you talking about for your second gallery?  While yes it would be true that the first gallery (if it can page) will page.  But the second gallery will not need to page because it is coming direct from memory in the app.

  • nBow Profile Picture
    46 on at

    Ahh yeah I guess it would be paging, but I need the second gallery to delegate data from the original source rather than take page data from gallery 1. I have more records than are paged in gallery 1 so gallery 2 will only show paged records. The filtering does work the way you said it would, but unfortunately if I scroll gallery 2 there will be missing records if they haven't loaded into the memory of the app. So maybe this isn't the proper solution to start with for checkbox filtering. It just made the most sense to me to have one gallery as a control and the other with the full data, but I don't think that type of many to many filter is possible due to PA limitations. I'll probably just move forward with my filter profiles function saved in a separate list on SP. Also it is a code free platform, but it's also used by many companies, like the one I work for, having less limitations for developers would still be nice, at my company I can't design a full web app otherwise I wouldn't have these issues. The limitations really put a hamper on how dynamic and responsive a powerapp can be. For example in code I can generate an array easily, in PA I need to jump through hoops to get an array for choice column updating. Even having a simple Each() function and Array() function built in would make a lot of things easier for exable ForEach(Gallery.AllItems, Checkbox.Value = true, ``do a function here`` AppendArray(GalleryArray, "{Value: " & Checkbox.Text & "}")) and then I'd have a table to patch a choice column based on a gallery with the data I want. Things like this are straight forward in normal web development and easy to make but in powerapps they are difficult.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @nBow 

    Well, first, ForAll is not a for loop!!  If you use it like one, you will be frustrated quickly.  It is a function that produces a table of records.

    Also, there is an array in PowerApps...it's a Table!  Tables are used everywhere in the app.  Very easy to create and very easy to update.

     

    Again though, you are trying to correlate no-code Excel-like design work (PowerApps) to a development platform (Web, .net, Java, etc.)  There could not be a more concrete "comparing apples to oranges" scenario!!

     

    PowerApps is very powerful and responsive and dynamic, but if it is "developed" like a program, then it will not be and it will be a pain.  If it is designed like an Excel spreadsheet (on steroids) then it will shine!

     

    I believe I was thrown when you were stating "Checkboxes".  Normally people are putting checkboxes in a Gallery for people to "Select" records.  So, as I assumed more of that role, it didn't make sense that the gallery would have paging issues because people would have to be scrolling through it to check boxes.

     

    But it sounds like your scenario is much different.  Are your Checkbox values associated with the records already?  Can you describe a little more?

  • nBow Profile Picture
    46 on at

    No unfortunately the checkboxes aren't associated with the data on the SP list. But that could be changed with either a text column or yes/no column to represent the checkbox on the data side. I think I'm going another direction with this project though in the end. The reason I didn't have them associated with the data initially is that I didn't want the data mutated on a global level. I only wanted the filter to work for one user, if I update the master list with yes/no then any user who views the data will have those columns filtered. My solution is to have a separate list that saves filtered choices in a choice column per user on SP and then to reference that record in the second gallery filter. I've actually ice boxed this feature for now though, because my users would like a more excel like experience and told me that this method would be useful but it's something that isn't exactly like excel. They'd rather have pane freezing like excel and to autofocus a scroll position for the columns they wish to view, so that's where I'm going with the app now.
    Yeah I don't mean disrespect to PA it's very powerful, I just feel that for users with web experience adding code solutions as an option would be nice. The components and development as a whole seems to be based on Web languages when I look at functions and font settings and whatnot it's clearly JS and CSS simplified, so I don't feel that this would be a huge jump for the app to allow a more in depth code option for developers. For the most part everything about powerapps allows users like myself to develop apps extremely fast, compared to standard web development, but there are times where I wish I had the option to incorporate custom components that have functionality that isn't offered out of the box with powerapps. I'm going to mark your original solution as the solution for this issue tho, for other users, because I feel my usecase is very specific.

  • aayaanmayank Profile Picture
    248 on at

    Hi Randy thanks for this solution, i can only see the number of buttons appearing based on the check box selection however texts are missing from the buttons

  • aayaanmayank Profile Picture
    248 on at

    Screenshot for your referenceScreenshot.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

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

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard