Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filtering a gallery using a dropdown

(1) ShareShare
ReportReport
Posted on by

Good Monday, 

I want to add a filter this gallery based upon the floor levels using a dropdown as I have another filter in the gallery that only displays rooms from "RS_KS11100" on the roomsgallery items

 

The floors are labeled in the room names by the number at the end of "RS_11100_X"

 

for example,

RS_KS11100_1 is on the first floor

RS_KS11100_2 is on the second floor

then it goes up to the fifth floor

 

Screenshot 2024-07-15 083339.png

 

this is what it looks like right now

  • fhamm Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    Awesome! Glad it worked 🙂

  • hotdogman Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    it works @fhamm ily, have a good day this monday

  • hotdogman Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    Yes that makes sense, I'll get it a try right now

     

  • Verified answer
    fhamm Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    If I'm understanding how you're using the filter currently, I'd change it to this:

    Filter(AvailableRoomEmailName, StartsWith(Name, varFloor) && Name <> "RS_KS11100_1 - Theater" && Name <> "RS_KS11100_1 - Auditorium")

     If you set up the varFloor variable right, it should change to RS_KS11100_X with X being the floor selected in the dropdown box. Does that make sense/work with what you're trying to do?

  • hotdogman Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    im kinda dumb, could you show me how I can incorporate the last part in my filter

    hotdogman_0-1721058579286.png

     

  • fhamm Profile Picture
    on at
    Re: Filtering a gallery using a dropdown

    Perhaps you could try to set a variable OnChange of the dropdown that you can refer to in your filter code.

     

    First, you'll either want to set the default of the dropdown to something that isn't a floor number (like "select floor" or something) OR set your floor variable to the initially shown value (in this case, 1) on App Start.

     

    OnChange of dropdown:

    Set(varFloor, "RS_KS11100_"&Text(Dropdown1.Selected.Value))

     

    Then in your filter code, refer to the varFloor variable in the StartsWith expression where you want to filter for the floor:

    StartsWith(Name, varFloor)

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard