web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter gallery ...
Power Apps
Unanswered

How to filter gallery selections on either button or Combobox

(0) ShareShare
ReportReport
Posted on by 503

Hi all 

 

I have a gallery that displays a variety of fruit depending on which button is selected prior to opening up with gallery. 

 

I now want to add a combo box in the mix so if the user decides to select the variety of fruit using the combo box then it will still bring up the gallery.

 

So I am trying to filter the datasource/gallery using the variable set of the button selection and the combo box selection if the user decides to use the combo box. 

 

Here is the formula im trying to use - 

 

 

 

Filter(Table15, Variety=VarietySelection && Variety=ComboBox2_10.Selected.Description)

 

 

 

 

If I just use this- 

 

 

 

Filter(Table15, Variety=ComboBox2_10.Selected.Description)

 

 

 

It works but only filters based off of the combo box selection. 

 

Or this works filtering with variable created with button selection- 

 

 

Filter(Table15, Variety=VarietySelection)

 

 

 

But i need it to filter both, just in case the user selects one or the other. 

 

Thanks everyone for any help 

 

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    My advice is to use or button or combobox

    To filter by combobox:

     

    If( IsBlank(ComboBox2_10); Table15; Filter(Table15; Variety = ComboBox2_10.Selected.Description)

    If you really want that, you can try to insert an AND in that filter... But i dont think it is a good idea...

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Usernametwice23 ï¼Œ

     

    I did a test for you.

    1\ This is my list

    vxiaochenmsft_0-1628760588946.png

    2\ Add a combo box control 'ComboBox1' and set its Items property to:

    Distinct(LIST153,Fruit_type)

    Set its DisplayFields property to:

    ["Result"]

     

    3\ Add a reset button and set its onselect property to:

    ClearCollect(Col,{Type:"1"});Clear(Col);Reset(ComboBox1)

     

    4\ Add 3 button controls and set their onselect property to:

    ClearCollect(Col,{Type:"1"})
    ClearCollect(Col,{Type:"2"})
    ClearCollect(Col,{Type:"3"})

     

    5\ Add a gallery control and set its Items property to:

    Filter(ForAll(LIST153 As A,If(A.Fruit_type in Col.Type||A.Fruit_type in ComboBox1.SelectedItems,A,Blank())),!IsBlank(Fruit_name))

     

    6\ The result is as follows:

    AAA.gif

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Usernametwice Profile Picture
    503 on at

    Hi @v-xiaochen-msft 

     

    Thank you greatly for the help. 

     

    This seems to be working for my combo box, but the problem is that my buttons are in a gallery and not separate as seen in your post. Also my buttons are also based off of another gallery selection so I cant change them to be separated like yours.

     

    Is there a way around this? Or you think that the buttons need to be not in a gallery for it to work? 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard