Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

How to filter floor levels using a dropdown

(1) ShareShare
ReportReport
Posted on by

Happy Thursday,

I want to filter the rooms on my gallery based on the floor they are on by using a dropdown. If there's a better alternative than a dropdown, please let me know!

 

For example,

RS_KS11100_1 is the first floor 

RS_KS11100_2 is the second floor

and eventually goes up to the fifth floor

here's what I was cooking (

hotdogman_1-1720720353581.png

 

  • Giraldoj Profile Picture
    561 Super User 2025 Season 1 on at
    Re: How to filter floor levels using a dropdown

    Hi @hotdogman 

     

    your current filter + @venturemavenwil recommendations on mine should look something like this:

    Filter(
     colRooms,
     Floor = DropdownFloor.Selected.Value &&
     StartsWith(Name, "RS_KS11100")
    )

     

    If my response resolved your issue, please feel free to mark it as the solution by clicking accept it as a solution

    If you liked my solution, please give it a thumbs up
    This helps others find the answer more easily.

    Connect with me: LinkedIn 

     

  • hotdogman Profile Picture
    on at
    Re: How to filter floor levels using a dropdown

    hotdogman_0-1720806663357.png

    I have another filter in the gallery, how could I incorporate the dropdown filter

     

  • venturemavenwil Profile Picture
    600 Super User 2025 Season 1 on at
    Re: How to filter floor levels using a dropdown

    @Giraldoj 's solution is sound, though I would just like to make the following changes:

    For the page's onvisible property, use

     

    ClearCollect(
     colRooms,
     AddColumns(
     Rooms,
     'Floor', Right(RoomID, 1)
     )
    )

     


    Afterwards, in your dropdown you can simply do:

     

    Distinct(colRooms, Floor)

     

    And in your gallery

     

    Filter(
     colRooms,
     Floor = DropdownFloor.Selected.Value
    )

     

    This makes sure that the floor is populated dynamically (For example, if in the building doesn't have a 4th floor, then it wouldn't show up in the dropdown, and you also wouldn't have to worry about type conversion.

  • Giraldoj Profile Picture
    561 Super User 2025 Season 1 on at
    Re: How to filter floor levels using a dropdown

    Hi @hotdogman 

     

    you can filter your gallery using the filter function, doing something like this

    1. Dropdown Control Configuration:

    Insert the dropdown control and set its Items property:

     

     

    ["1", "2", "3", "4", "5"]

     

    1. Gallery Items Property:

    Assuming your data source is named Rooms and the room identifiers follow the format RS_KS11100_1, RS_KS11100_2, etc., use the following formula for the gallery's Items property:

     

     

    Filter(
     Rooms,
     Value(Mid(RoomID, Len(RoomID) - 1, 1)) = Value(DropdownFloor.Selected.Value)
    )

     

    Explanation

    • Mid Function:

      • Mid(RoomID, Len(RoomID) - 1, 1): Extracts the floor number from the RoomID string. This assumes that the floor number is always the second last character in the RoomID.
    • Value Function:

      • Value(...): Converts the extracted string floor number to a numeric value for comparison.

    I hope that solution works for you, but what you mean with "If there's a better alternative than a dropdown, please let me know!" that totally depends on your requirement, you can use a loot of different thing to do the filter like check boxes, times, names idk basically anything, you need to tell us what is your requirement to recommend the best approach.

     

    If my response resolved your issue, please feel free to mark it as the solution by clicking accept it as a solution
    This helps others find the answer more easily.

    If you liked my solution, please give it a thumbs up
    would be greatly appreciated. Thank you!

     

    Connect with me: LinkedIn 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard