web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sorting by Ascending o...
Power Apps
Answered

Sorting by Ascending or Descending in Dropdown

(0) ShareShare
ReportReport
Posted on by 230

Hi Community - I haven't been able to figure this one out but I am hoping it's pretty simple. The issue is that the list of items in my drop down are not sorted properly in accordance with the code listed below. To get the items for my drop down, I am finding the distinct values from my column called "Column Name" which is stored in a SharePoint List called "ListName".  I am then looking to sort these in ascneding order.

 

Thanks in advance.

 

 

Sort(
 Distinct(
 'ListName',
 Trim('ColumnName')
 ),
 Ascending
)

 

 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Have you tried SortByColumns. Also what type of values do you have in the column, numbers or text?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tlevine Profile Picture
    230 on at

    @eka24  - the column is text, but I have not tried sortbycolumns, i will try this now and share the results

  • Verified answer
    tlevine Profile Picture
    230 on at

    @eka24 hi - I was able to achieve the results successfully using the following structure:

     

    Distinct(
     Sort(
     'ListName',
     Trim('ColumnName'),
     Ascending
     ),
     'ColumnName'
    )
  • eka24 Profile Picture
    20,923 on at

    That's fine. Mark the solution to close it since it resolved

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • GREGWOUARE Profile Picture
    39 on at

    Hi there,

     

    I don't know why, but in my case, I had to type 

    SortOrder.Ascending
    to make it works
     
    Anyway thanks you for your help

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard