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

Delegation problem for sharepoint with filter function and IN operator

Hello together,

 

i have created an desk booking app. Now i have almost 8000 delegation warnings + performance problems. I think the performance is the result of the 8000 delegation warnings. It show always the same code, which is not delegated.

 

If(
    IsEmpty(
        Filter(
                Desks; 
                    Desksname = Button3_87.Text; 
                    DeskID in Filter(
                                    Reservattions; (date = Argument1 && Morning <> Not(Argument2) && Status.Value = "planned") ||
                                    (date= Argument1 && Morning <> Not(Argument2) && Status.Value = "checked_in") ||
                                    (date = Argument1 && Afternoon <> Not(Argument3) && Status.Value = "planned") ||
                                    (date= Argument1 && Afternoon <> Not(Argument3) && Status.Value = "checked_in")
                                    ).Title
            )
        );
            LightGreen; 
red ; )

 

I found out, that the Power Apps get delegation problems by using sharepoint with some function and operators like the IN operator. Does anyone have an idea how can i change the code that there is no delegation warning anymore?

 

Thank you.

 

 

Best regards

1 REPLY 1
WarrenBelz
Super User
Super User

Hi @CanD ,

Firstly, Delegation will always be an issue to manage in a large SharePoint list - you have two significant Delegation issues with this code.

If(
   IsEmpty(
      Filter(
         Desks; 
         Desksname = Button3_87.Text; 
         DeskID in Filter(
            Reservattions; 
            (
               date = Argument1 && Morning <> Not(Argument2) && 
               Status.Value = "planned"
            ) ||
            (
               date= Argument1 && Morning <> Not(Argument2) &&
               Status.Value = "checked_in"
            ) ||
            (
               date = Argument1 && Afternoon <> Not(Argument3) && 
               Status.Value = "planned"
            ) ||
            (
               date= Argument1 && Afternoon <> Not(Argument3) && 
               Status.Value = "checked_in"
            )
         ).Title
      )
   );
   LightGreen;
   red 
)

 The in operator is not Delegable and the relational lookup to Reservations is not Delegable (SharePoint is not a relational database). How many items are in the lists (both) and how many would match the filter Desksname = Button3_87.Text

I also have a blog you might find useful

 

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,144)