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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (30,768)