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 / Sort delegation and dy...
Power Apps
Answered

Sort delegation and dynamic column issues

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I tried a number of different ways of doing this and after reading an article (With Statement managing Delegation – Practical Power Apps) by @WarrenBelz, I managed to get rid of the delegation error but still can't get my column name to work in a variable for a dynamic sort. Note, the filter works fine, the problem is with the sort. My questions are...

  1. Can someone explain why both the column name variable (varSortPractitionerCol) and the sort direction variable (varSortPractitionerDir) are not delegable in the commented-out example?
  2. In the commented-out example, even when I use the literal column name (PTR_LastName), which works, with the sort direction variable (varSortPractitionerDir), the sort direction variable gives a delegation warning, Why?
  3. I am assuming from the article that putting my results in local storage with the With statement resolves the delegation issue, correct? 
  4. Finally, and most importantly, why will my column name variable (varSortPractitionerCol) not work even though it is the same as the literal column name (which works when I put it it) and how do I resolve it?

KevinApp_0-1667603934150.png

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,924 Most Valuable Professional on at

    Hi @Anonymous ,

    You need to use SortByColumns (not Sort) if you want a Variable sort column name as this takes a Text input, whereas Sort takes the column name, which cannot be set dynamically with a Text value.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I had some other things wrong, this being one of them. But why would it give me a delegation warning with no error msg and just not work? I think the built-in error handling could be better on this function.

  • WarrenBelz Profile Picture
    154,924 Most Valuable Professional on at

    Hi @Anonymous ,

    You could be right on the error handling at times . . .

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard