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 / Filter gallery based o...
Power Apps
Answered

Filter gallery based on a label in that gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello there!

I am having a gallery which I want sorted based on a column in my database.

It has a few values like these for example, which are the floor levels;

V1
V2
V3
V4
....
V11
etc

Now I can't filter the gallery based on that value since it isn't a number, because the V in front of it. I've made this formula to only get the floor level;

If(Len(TestLabel.Text) = 2; Right(TestLabel.Text; 1); Right(TestLabel.Text; 2))


So now that I have the floor level, I tried to Sort the gallery by simple doing this code but it gives me the error that I can't do it like this. How can I fix this?

Sort(
 If(
 DropdownDeelorder.SelectedText.Result = "All";
 OpleverApp;
 Filter(
 OpleverApp;
 DropdownOrder.SelectedText.Result = Order && DropdownDeelorder.SelectedText.Result = Deelorder
 )
 ); Text(TestLabel.Text))
 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @Anonymous ,

    I am hoping this simple issue does not turn into something complex, but here goes . . .

    You simply need to strip off the first character and then get the value of the result - you have not posted the name of the column in your list that contains the floor no, but replace what I have with that

    Sort(
     Filter(
     AddColumns(
     OpleverApp,
     "SortNo",
     Value(
     Right(
     YourFloorField,
     Len(YourFloorField)-1
     )
     )
     ),
     DropdownDeelorder.Selected.Result = "All" ||
     (
     DropdownOrder.Selected.Result = Order && 
     DropdownDeelorder.Selected.Result = Deelorder
     )
     ),
     SortNo
    )

    Also note that SelectedText is deprecated and may not work in the future, so use Selected.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey!

    Thank you for your answer, this worked perfectly! Thanks for the notify on SelectedText, I've used that everywhere... so I guess I have to go through all of my apps to fix that.

    Thanks for your time!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard