cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dbarrett
Advocate I
Advocate I

SharePoint List and Filter Delegation during ForAll

Hi all,

 

I'm hoping someone can explain why delegation for the filter on RecordID is failing in the following formula:

 

ForAll(colUniformItemsDeletedEdit,

    Remove(UniformRecordToItems, First(Filter(UniformRecordToItems, RecordID = colUniformItemsDeletedEdit[@RecordID], ItemID = colUniformItemsDeletedEdit[@ItemID]))));

 

The formula works but will likely cause issues once we have more than 500 records in UniformRecordToItems.

 

UniformRecordToItems is a SharePoint List.

 

According to the documentation (https://powerapps.microsoft.com/en-us/tutorials/delegation-list/) using filter with = should be delegable. 

 

Running the Remove component (from the formula above) outside of the ForAll works correctly. e.g.

 

Remove(UniformRecordToItems, First(Filter(UniformRecordToItems, RecordID = "20171012082124-d.barrett", ItemID = 1)))

 

I'm keen to understand what I'm doing wrong.

 

Regards,

David

 

 

3 REPLIES 3
v-monli-msft
Community Support
Community Support

 Hi @dbarrett,

 

I think this is because that ForAll can't be delegated. Only the first portion of the list will be retrieved and then the function applied. The result may not represent the complete story. A blue dot will appear at authoring time to remind you of this limitation and to suggest switching to delegable alternatives where possible. 

 

For your reference:

https://powerapps.microsoft.com/en-us/tutorials/function-forall/

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mona,

 

In this context, would the ForAll not remain local whereas the filter be delegated?

 

Regards,

David

Hi again,

 

My question probably wasn't clear. The following formula has a problem with delegation:

 

ForAll(colUniformItemsDeletedEdit,

    Remove(UniformRecordToItems, First(Filter(UniformRecordToItems, RecordID = colUniformItemsDeletedEdit[@RecordID], ItemID = colUniformItemsDeletedEdit[@ItemID]))));

 

UniformRecordToItems is a SharePoint list. PowerApps complains about RecordID in "First(Filter(UniformRecordToItems, RecordID = colUniformItemsDeletedEdit[@RecordID]".  The issue: "Part of the Filter formula cannot be evaluated remotely due to service limitations..."

 

I would expect the ForAll would simply pass record fields (i.e. variables) to the filter, with the filter then being delegated to SharePoint. Is PowerApps not smart enough to separate the logic to determine what should and shouldn't be delegated?

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,723)