Re: How to filter floor levels using a dropdown
Hi @hotdogman
you can filter your gallery using the filter function, doing something like this
Dropdown Control Configuration:
Insert the dropdown control and set its Items property:
["1", "2", "3", "4", "5"]
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