cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Melissa33
Frequent Visitor

Trying to filter my browser gallery using a button :)

Hi

This is probably a simple question but I have been stumped on it for a while, I am looking to create a button that filters my browser gallery. The filter will be used to filter a list of users based on the class that they are in. I have tried a variety of filter function which haven't worked as well as attempting the Search function yet still have had no luck.

 

Sorry if this is simple, just need someone to look at the problem with a fresh pair of eyes.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Melissa33,

Do you want to filter the Gallery based on the button using the Filter() function?

Could you please share a bit more about the scenario?

If you want to click a button to filter the gallery, you should use the collection.

Not sure how you filter a list of users based on the class that they are in, I just try to give a sample for reference.

Add a Filter button and set the OnSelect as below:

ClearCollect(FilterUsers,Filter(YourDataSource,Class="Tech"))

Set the Items property of the Gallery as below:

FilterUsers

Or if you want to cancel this filter action, you could use the variable.

Add a button and set the OnSelect as below:

UpdateContext({Filter:!Filter})

Set the Items property of the Gallery as below:

If(Filter,Filter(YourDataSource,Class="Tech"),YourDataSource)

Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @Melissa33,

Do you want to filter the Gallery based on the button using the Filter() function?

Could you please share a bit more about the scenario?

If you want to click a button to filter the gallery, you should use the collection.

Not sure how you filter a list of users based on the class that they are in, I just try to give a sample for reference.

Add a Filter button and set the OnSelect as below:

ClearCollect(FilterUsers,Filter(YourDataSource,Class="Tech"))

Set the Items property of the Gallery as below:

FilterUsers

Or if you want to cancel this filter action, you could use the variable.

Add a button and set the OnSelect as below:

UpdateContext({Filter:!Filter})

Set the Items property of the Gallery as below:

If(Filter,Filter(YourDataSource,Class="Tech"),YourDataSource)

Regards,

Qi

Best Regards,
Qi

View solution in original post

Alright will give this a try

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,325)