Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Help needed when the filtering out the Gallery control after using the button control

Adding this to a new post in the general discussion page as i can't reply in the 'Ask Microsoft anything event


I'm currently creating a lead generation app, which will provide accessibility to the sales team in my organisation to submit leads for instrument orders. The team that I'm building this for used to use excel and asked the sales team to fill out an excel form. 


With the help of the case management app, i have pretty much used quite a lot of the aspects within that template. I am having a problem when the filtering out the Gallery control after using the button control on the 'home' screen. To explain a little further, the button control is using an OnSelect statement containing: ClearCollect(CustomFilter,{type:"Status",id:0,value:"All"},{type:"email_address",id:0,value:"User().email"});Navigate('Lead List View',Fade).


I have a small feeling that is wrong as it's not pointing directly to the gallery. The Items section in the gallery is set to the entity name of where my information is stored (screenshot below)



Any help is much appreciated Smiley Very Happy.



Community Support Team
Community Support Team

Re: Help needed when the filtering out the Gallery control after using the button control

Hi @stephej,


I noticed that you use a ClearCollect to delete all the records from the CustomFilter collection and then adds a different set of records to the same collection. But you then didn't use this collection but your own entity in the gallery. 


May I know why you create the collection if you do not use it later?


For your reference about clearcollect function:






Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Help needed when the filtering out the Gallery control after using the button control

Hi Mona,


So the only reason i was using a 'ClearCollect' is that i am pretty much following how the case management app was built without the filter. 


On my first screen i have all 5 buttons, which once clicked will show different things like All leads, Active Leads, Closed leads etc. Once clicked, i want the gallery to filter out to only show the say active leads and to only show the leads generated by the person using the app (which i think is the user().full name function).View all leads screenshot.jpg


Obviously i don't have a 'CustomFilter' collection but then again, I'm not that sure on how to put what I've built in my gallery as a 'collection' or is there another way to get the gallery to filter once each of the buttons is selected? For example, UpdateContext?


Any helpful tips is very much appreciated as I'm at a loose end with this one 🙂




Helpful resources

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.


Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,131)