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 / SortbyColumns does not...
Power Apps
Answered

SortbyColumns does not allow other columns to set the order of the list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

I am trying to use the SortByColumns function to sort the list in the app based on the priority of each item, but the function only allows me to sort by the title of the items.

I have no problems if I use the following function (I am also filtering the list items that area already completed):

SortByColumns(Filter(MyListName; StartsWith(Title; TextSearchBox1.Text) && Estado.Value <> "Completado" );"Title"; If(SortDescending1; Descending; Ascending))

 

But when I try to filter based on the Priority, it says it has an error but it doesn't specify which error it is. I only change the "Title" for "Priority".

SortByColumns(Filter(MyListName; StartsWith(Title; TextSearchBox1.Text) && Estado.Value <> "Completado" );"Priority"; If(SortDescending1; Descending; Ascending))

 

In my sharepointlist, the column is named "Prioridad" (it does not work with that name either), but in the sharepoint list I found that the original name of the column was Priority:

https://sitename/teams/MyListName/_layouts/15/FldEdit.aspx?List=%7B9937ACAF%2DE2C4%2D465D%2DA325%2D8EE5728BA612%7D&Field=Priority

 

does anyone know how to make it work with anything other than the Title?

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    What kind of column is Priority?

    If it is a choice column, then you need to alter your formula to account for that.  

    SortByColumns will only accept "real" names of columns (as you found in the list settings) and only simply types (text, number, etc).

     

    So, if your Priority is a choice column, then this will give you the results you would like:

    SortByColumns(
     AddColumns(
     Filter(MyListName; 
     StartsWith(Title; TextSearchBox1.Text) && Estado.Value <> "Completado" 
     );
     "_priority"; Priority.Value
     );
     "_priority"; 
     If(SortDescending1; Descending; Ascending)
    )

     

    I hope this is helpful for you. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    THANK YOU!!!! Yes, that was the solution to my problem!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard