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 / Dropdown not working c...
Power Apps
Answered

Dropdown not working correctly as filter for gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm new to PowerApps, so excuse what is probably a simple question. I'm adding a dropdown to my app and I want it to filter the gallery results. My dropdown is called Dropdown1, table is Products, and the column is StoreNum. Here is what I have in teh OnSelect of the dropdown: Filter(Products,StoreNum = Dropdown1.Selected.Value)

 

I get no errors, and when I test it, it spins for a minute and then continues displaying the unfiltered results. What am I doing wrong?

 

 

Categories:
I have the same question (0)
  • FelixCuadrilla Profile Picture
    Microsoft Employee on at

    I don't know if I got this straight, but I think I created something similar to what you need. I think the problem is that you are trying to set the value of the dropdown (or you meant gallery?) from the OnSelect option which cannot change the contents of the dropdown (unless you store that into a variable, but thats not needed for this example).

     

    In this example, my table is name AWProducts, my dropdown DropDown1 and my column name sport:

     

    example.png

     

     As you can see I'm setting the Items property in the gallery as the result of the filtered dropdown.

     

    Replace AWProducts with Products and Sport with StoreNum and you should have a similar result.

     

     

  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi Tambe257,

     

    Please try to set the Items property of the Gallery control as Filter(Products,StoreNum = Dropdown1.Selected.Value).


    This part “Build an app from scratch” in this documentation about “Understand data forms in Microsoft PowerApps” could be a reference for you:
    https://powerapps.microsoft.com/en-us/tutorials/working-with-forms/

     

    Best regards,
    Mabel Mao

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Mabel. I had put the filter on the dropdown instead of the gallery itself. Now one more question....

     

    The filter works great. I and filtering products per store, so the dropdown selects a store #, and only shows the products at that store. I also want to search those filtered products. I have a text input called TextInput1 and am searching the column called ItemNameWeight. I tried:

     

    Search(Filter(Products,StoreNum = Dropdown1.Selected.Value), TextInput1.Text,"ItemNameWeight")

     

    When I use the above code the filter of the store works, but then when I search, it returns the search items from all stores. How can I limit it to searching only the filtered items?

     

    I also tried to create a search button. I have this in the OnSelect of the button: UpdateContext({ searchTerm: TextInput1.Text }) and I changed the above code to this:

     

    Search(Filter(Products,StoreNum = Dropdown1.Selected.Value), searchTerm,"ItemNameWeight")

     

    If I choose a store number and search a blank input, then it returns the store products, but if I choose a store and search "Coke" for instance, I get all of the Coke products at all of the stores, regardless of what store number is in the dropdown.

     

    Thanks in advance for the help!

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, thanks!

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard