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 / Filter Gallery using b...
Power Apps
Answered

Filter Gallery using button

(0) ShareShare
ReportReport
Posted on by 6

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.

 

 

App Question.JPG
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,653 Most Valuable Professional on at

    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

  • Helicon Profile Picture
    6 on at

    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

  • Verified answer
    Pstork1 Profile Picture
    69,653 Most Valuable Professional on at

    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


     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard