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 / Sortbycolumn not working
Power Apps
Answered

Sortbycolumn not working

(1) ShareShare
ReportReport
Posted on by 426

Can someone guide me on this. i got a dropdown menu that i want to set the items.

It supposed to drop down the list based on department, i;ve tried department.value. 'Department' or "Department" but its not retrieving the data from the sharepoint list. Captured below are my screenshots. It works fine if i use SortByColumns('Leslie New Sharepoint List',"Full_x0020_Name")

Department.jpg

Department sortbycolumns.jpgTemp table.jpg

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

    Hi @nchandran ,

    Try this

    SortByColumns(
     AddColumns(
     ’Leslie New Sharepoint List’,
     "DeptSort",
     Department.Value
     ),
     "DeptSort"
     )

     

    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.

  • nchandran Profile Picture
    426 on at

    hi,

     

    its not working,

    suggestion not working.jpg

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi @nchandran 

     

    In SharePoint, could you please click on your Cog (top-right), then choose list settings,

    image.png

     

    then scroll down until you see the column name and click on it

     

    image.png

     

     

    now, inside your address bar you will see at the end the name of the column as SharePoint sees it - this is what we use when we reference SharePoint columns using " " which is what SortByColumns requires:

     

    image.png

     

     

    Could you try using that name after &Field= in your SortByColumns quotes " " and let me know if that works?

     

    Thanks,

    Sancho

  • nchandran Profile Picture
    426 on at

    this is the screenshot of the sharepoint column which im targetting.

     

    department.jpg

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    @nchandran ,

    You have put Filter in front of it - it does not need this.

  • nchandran Profile Picture
    426 on at

    ok i've removed filter but the dropdown is not working.department pull down empty.jpg

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @nchandran ,

    My code is a complete workaround as you cannot sort by a Choice field. I got the code you have working, but needed to save it and come back for it to update.

    If you really need SortByColumns (to reference other fields directly rather than by Lookup), I think this is the only option.

     

    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.

     

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @nchandran ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    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.

  • Verified answer
    nchandran Profile Picture
    426 on at

    Hi,

    I found out that i had to change the properties value to Deptsort inorder to see the results. Thank you soo much!!!

    I got this working but there are mutiple duplicates, so i've decided to add a distinct feature on it. Works great.

    Distinct(SortByColumns(AddColumns('Leslie New Sharepoint List',"DeptSort",Department.Value),"DeptSort"),DeptSort)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard