cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nchandran
Helper V
Helper V

Sortbycolumn not working

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

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.

View solution in original post

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)

View solution in original post

9 REPLIES 9
WarrenBelz
Super User
Super User

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.

View solution in original post

hi,

 

its not working,

suggestion not working.jpg

iAm_ManCat
Super User
Super User

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

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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

 

department.jpg

@nchandran ,

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

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

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.

 

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.

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)

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,701)