Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0MYPq3uMmAFXoWOFNoXYxa
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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 388 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 193

#3
stampcoin Profile Picture

stampcoin 147

Overall leaderboard
Loading started