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

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

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard