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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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