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
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
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?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
200 | |
70 | |
50 | |
46 | |
20 |
User | Count |
---|---|
255 | |
119 | |
84 | |
79 | |
69 |