Showing results for 
Search instead for 
Did you mean: 
New Member

Powerapps SortByColumns not working for Lookup and OptionSet column values.

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. 

Super User III
Super User III

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."

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (70,210)