cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AakashJaiswal
Helper V
Helper V

Delegation Warning while filtering a Sharepoint list

Hi,

 

I am tired of the delegation warning appearing everywhere in my app where I am using the filter formula to filter my backend database located on Sharepoint. I read many threads about this issue being faced by other people but none of the solutions worked for me. I don't know what am I doing wrong. Attached is the screenshot for your reference.

 

Screenshot (393).png

 

Please help.

 

Aakash

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Pstork1 ,

 

I found the solution for all the 3 cases.

 

Case 1: The delegation warning was happening due to ambiguity in column name (both had value columns)

Case2: Filtering a table by a column from another table. (This works but has performance issues) 

Clear(Table3);
ForAll(Table1, Collect(Table3, Filter(Table2, ColumnA=Table1[@ColumnA])))

Case3: I just created a collection using the same filter formula. Then I did a sum on this collection.

ClearCollect(TotalHours,Filter(EffortHoursDatabase,ResourceName = ProfileDisplayName)); 
Sum(TotalHours,Hours)

 

Regards,

Aakash

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

The problem is that you are using an embedded function in the filter statement.  Try changing your statement to something like this and see if that doesn't clear the warning.

set(ProfileDisplayName, Office365User.MyProfile().DisplayName);ClearCollect(MyRequests,Filter(TaskPlannerDatabase, RequestorName = ProfileDisplayName));


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 ,

 

Thank you for your reply. Your solution worked like a charm. However, I am facing Delegation warnings in 3 more cases. Can you help me with that as well? With this, my app will be delegation warning free.

 

Case 1

Screenshot (394).png

 Case 2 (If I change it to TaskId = MyAssignmnets.TaskID, it says "Invalid Argument Type") - TaskId is a column

1.png

 Case 3

2.png

 Aakash

 

 

 



 

Case 1: Not '!' is non delegable.  Instead write it as ...Value = false.

Case 2: I don't have a way to solve this.  You are getting the error because ID is probably and Integer and 'in' is strictly a text search.  But 'in' is also non-delegable so it won't work anyway in terms of delegation.

Case 3: I can't really solve this one either.  Sum() is a non-delegable function.  Assuming the Filter() never returns more than 500 records, you can safely ignore the warning.  Otherwise the workaround is to pull the records into a collection using multiple filters that will get each dataset below 500 records then do the SUM() on the local collection

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 ,

 

I found the solution for all the 3 cases.

 

Case 1: The delegation warning was happening due to ambiguity in column name (both had value columns)

Case2: Filtering a table by a column from another table. (This works but has performance issues) 

Clear(Table3);
ForAll(Table1, Collect(Table3, Filter(Table2, ColumnA=Table1[@ColumnA])))

Case3: I just created a collection using the same filter formula. Then I did a sum on this collection.

ClearCollect(TotalHours,Filter(EffortHoursDatabase,ResourceName = ProfileDisplayName)); 
Sum(TotalHours,Hours)

 

Regards,

Aakash

Aditya1105_0-1626166945018.png

Can anyone help me

Please post this as a new question rather than adding it as a reply to an old thread.  It won't really get the same exposure here.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,939)