cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (18,642)