cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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.
Anonymous
Not applicable

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.
Anonymous
Not applicable

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

Anonymous
Not applicable

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,137)