Skip to main content

Notifications

Community site session details

Community site session details

Session Id : qN3jDTVHoaMMkaZha+Svvt
Power Apps - Building Power Apps
Unanswered

Powerapps SortByColumns not working for Lookup and OptionSet column values.

Like (0) ShareShare
ReportReport
Posted on 1 Oct 2020 07:47:49 by

I have a DataTable which is having Lookup and OptionSet columns. when i am trying to sort the columns then there arises an error: "Function sortByColumns has some invalid arguments".Also it is not taking relationship data.Can anyone help me out to solve the problem. 

Categories:
  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on 08 Oct 2020 at 12:05:21
    Re: Powerapps SortByColumns not working for Lookup and OptionSet column values.

    @Anonymous 
    Unfortunately, SORTBYCOLUMNS can only be used on simple data types: text, number, date, boolean, etc.  It cannot be used in cases where the column holds a record: lookup, options set, etc.  You will need to try a strategy like this instead.

     

    Sort(Sort(Sort(your_datasource_name, Column1.Value, Ascending), Column2.Value, Ascending), Column3.Value, Ascending)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 54

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 42 Super User 2025 Season 1

Overall leaderboard
Loading started