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 floor le...
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

 

Categories:
I have the same question (0)
  • Giraldoj Profile Picture
    762 Super User 2025 Season 2 on at

    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 

  • venturemavenwill Profile Picture
    1,189 Super User 2025 Season 2 on at

    @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.

  • hotdogman Profile Picture
    on at

    hotdogman_0-1720806663357.png

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

     

  • Giraldoj Profile Picture
    762 Super User 2025 Season 2 on at

    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 

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard