cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KimberlyM
Level 8

Delegation Issue - Sort and If Statements

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

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Delegation Issue - Sort and If Statements

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.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Delegation Issue - Sort and If Statements

@KimberlyM 

Is Status a Choices column in Sharepoint?

KimberlyM
Level 8

Re: Delegation Issue - Sort and If Statements

Yes, Status is a Choice column in SharePoint.

Super User
Super User

Re: Delegation Issue - Sort and If Statements

...deleted...

 

Dual Super User
Dual Super User

Re: Delegation Issue - Sort and If Statements

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.

View solution in original post

Highlighted
KimberlyM
Level 8

Re: Delegation Issue - Sort and If Statements

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,534)