I've been having some trouble with PowerApps throwing me delegation warnings when working with a Sharepoint list.
Here is the code I'm using to pull in Sharepoint list data in "chunks" of 500 at a time.
- 'eRad Cases' - Sharepoint List I am pulling data from
- miniID : calculated Numeric sharepoint field that is an auto-incremented integer (NOT the original ID that is assigned to each record)
- colMiniCaseList : collection generated from the Sharepoint list
UpdateContext({ctxMinRecID:First(SortByColumns('eRad Cases',"miniID",Ascending)).miniID});
UpdateContext({ctxMaxRecID:First(SortByColumns('eRad Cases',"miniID",Descending)).miniID});
UpdateContext({ctxNumberofPasses:RoundUp((ctxMaxRecID-ctxMinRecID)/500,0)});
ClearCollect(colNumbersTable,Filter('[dbo].[NumbersTest]',Number<=ctxNumberofPasses));
ForAll(colNumbersTable,Collect(colMiniCaseList,Filter('eRad Cases',miniID>=ctxMinRecID+((Number-1)*500) && miniID<ctxMinRecID+(Number*500)))- ctxMinRecID : minimum record ID grabbed from Sharepoint list
- ctxMaxRecID : maximum record ID grabbed from Sharepoint list
- ctxNumberofPasses : determines how many "chunks" of 500 I need in order to download the entire list
- '[dbo].[NumbersTest]' : used to generated colNumbersTable ... simply used as an ordered list in order to record how many records need to be pulled
My issue is that somewhere in my code, PowerApps doesn't think that the Sharepoint list is delegable, which I feel stems from the First() function. I previously had this set up with a SQL database and PowerApps has no issue delegating the First(SortByColumns( '[dbo]' )), given the SortByColumns() already delegated through the SQL database and First() was just grabbing the first value in the list ... thus no flags were thrown (and data was fully retrieved.)
So, should Powerapps have been throwing me a flag when delegating this on a SQL database, or should the flag be ignored when delegating this on a Sharepoint list?
EDIT : It has to do with the ( + ) .... should have combed the documentation a bit better ...