cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KimberlyM Helper IV
Helper IV

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
Highlighted
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 Helper IV
Helper IV

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

 

Highlighted
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

KimberlyM Helper IV
Helper IV

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,293)