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 / Custom sort order from...
Power Apps
Unanswered

Custom sort order from lookup column

(0) ShareShare
ReportReport
Posted on by 202

Hi everyone! I have 2 SharePoint lists: List1-with the main data and  List2- with the list of countries. I created a Lookup column in List1 connecting with List2. 

I was wondering if is there a way to custom-sort the list of countries in the PowerApp, for example, UK and USA at the top of the list, and the remaining countries keep in alphabetic order. 

 

At the moment all countries are listed in alphabetic order.question about custom sort countries.jpg

Categories:
I have the same question (0)
  • Verified answer
    Rutu01 Profile Picture
    305 on at

    You could add a switch expression to perhaps have a top 10 list and then the remaining will be sorted alphabetically 

     

     

    Sort(["UK","New Zealand","Australia"],Switch(Value,"UK","0","Australia","1",Value))

     

    Or 

     

    SortByColumns(AddColumns(["Italy","UK", "Australia","Denmark"] As Countries, "CustomSortOrder",LookUp([{SortOrder:"1",Country:"UK"}], Country=Countries.Value).SortOrder),"CustomSortOrder",SortOrder.Ascending,"Value")

     

    Rutu01_1-1684857878786.png

     

     

  • turnerj3 Profile Picture
    2,039 on at

    SortByColumns will let you put the 2 up front.

    SortByColumns( YourList,"{YourColumn}",["UK","USA",SortOrder.Descending] )

  • batmanMon Profile Picture
    202 on at

    Thank you @Rutu01 !😊

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard