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

Filter Gallery using button

Hi All,

 

I would like to get some advise from you all!.

 

I have a gallery which gets all the record from a cds table.

I am now having three buttons and try to filter the gallery.

each button should represent an option set value from CDS hence I am trying to filter the gallery with button onclick event and filtering criteria is record status.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Filter Gallery using button

To add the search box just add another formula to the filter criteria that includes the search box. Text. 


@Helicon wrote:

Thanks! 


I followed your steps and i got the buttons to work as expected.

 

Now all i have to do is figure out how to put text search into the formula as well.

 

Thanks again!

 

Helicon


 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Filter Gallery using button

The problem when trying to do this kind of thing is that PowerApps is declarative and not procedural.  So you can't use a button to change the value of a property, like the Items property of the gallery directly.  What you have to do instead is to build your Items property to be based of the value of a variable and then use the variable in the Filter statement of the Items property of the gallery.  

 

For example, Assume I want to filter based on a text field containing a specific name.  My Items property on the gallery would read like this.

 

If(IsBlank(TargetName),'Data Source Name',Filter('Data Source Name',TargetName in Title))

 

then set the OnSelect of the Button to

 

set(TargetName, "Value to search")

 

when you click the button the variable will change and the filter will be applied



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Helicon
Level: Powered On

Re: Filter Gallery using button

Thanks! 


I followed your steps and i got the buttons to work as expected.

 

Now all i have to do is figure out how to put text search into the formula as well.

 

Thanks again!

 

Helicon

Dual Super User
Dual Super User

Re: Filter Gallery using button

To add the search box just add another formula to the filter criteria that includes the search box. Text. 


@Helicon wrote:

Thanks! 


I followed your steps and i got the buttons to work as expected.

 

Now all i have to do is figure out how to put text search into the formula as well.

 

Thanks again!

 

Helicon


 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 124 members 5,261 guests
Please welcome our newest community members: