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
RezaDorrani
Dual Super User II
Dual Super User II

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
mdevaney
Super User
Super User

@KimberlyM 

Is Status a Choices column in Sharepoint?

Yes, Status is a Choice column in SharePoint.

...deleted...

 

RezaDorrani
Dual Super User II
Dual Super User II

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

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,765)