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 / Delegation Issue - Sor...
Power Apps
Answered

Delegation Issue - Sort and If Statements

(0) ShareShare
ReportReport
Posted on by 193

I am not 100% sure why I have a delegation problem here but this is the first chunk of code after over a month of trying that works to do what I need (I have an image below to show what I am seeing in PowerApps). 

From reviewing documentation on delegation I assume it is because I may have what is determined to be a complex Sort function or is it because I have an If inside of an If?

Is there a suggestion on how I could get rid of my delegation issue on this piece of code? Delegation will become an issue with my app and so far I have been able to work around it. 

This code is checking to see if the user is listed in the admin SharePoint list or not and allowing access/data through based on that determination. Then it is loading the SharePoint list Lead_Data, my main SharePoint list, and only displaying on default rows that have the status Not Started or In Progress associated with it (I have tabs that on their OnSelect property allow other status types to display). 

Sort(
 If(
 varAdmin,
 Filter(
 Lead_Data,
 If(
 SelectedStatus = "All",Or(Status.Value = "In Progress", Status.Value = "Not Started"),Status.Value = SelectedStatus
 )
 ),
 Filter(
 Lead_Data,
 AssignedTo.Value = varUser || LeadMember1.Value = varUser || LeadMember2.Value = varUser || LeadMember3.Value = varUser || LeadMember4.Value = varUser,
 If(
 SelectedStatus = "All",Or(Status.Value = "In Progress", Status.Value = "Not Started"),Status.Value = SelectedStatus
 )
 )
 ),
Created, Descending)

 delegation.JPG

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @KimberlyM 

    Is Status a Choices column in Sharepoint?

  • KimberlyM Profile Picture
    193 on at

    Yes, Status is a Choice column in SharePoint.

  • mdevaney Profile Picture
    29,991 Moderator on at

    ...deleted...

     

  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @KimberlyM 

     

    Choice columns are delegable

    The Issue in your case is the use of the If statement in your Filter solution

     

    Please check my delegation vlog series where I have covered every possible SP field type and how to overcome the delegation issues

    https://www.youtube.com/playlist?list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • KimberlyM Profile Picture
    193 on at

    @RezaDorrani thank you for sending me here! I am now working my way through all the videos to understand this better!

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard