PowerApps. Need help with using Collect for a very large Sharepoint List

%3CLINGO-SUB%20id%3D%22lingo-sub-1106255%22%20slang%3D%22en-US%22%3EPowerApps.%20Need%20help%20with%20using%20Collect%20for%20a%20very%20large%20Sharepoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1106255%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3CBR%20%2F%3EI%20created%20an%20App%20to%20help%20workers%20in%20accessing%20and%20adding%20to%20a%20very%20large%20Sharepoint%20List.%26nbsp%3B%3CBR%20%2F%3EI%20organized%20the%20data%20by%20creating%20a%20new%20field%20in%20the%20list%20(Logbook%20ID).%20Everytime%20a%20worker%20creates%20a%20new%20Logbook%20ID%2C%20they%20can%20easily%20create%20new%20list%20entries%20with%20the%20same%20ID%20so%20they%20are%20able%20to%20access%20that%20set%20of%20entries%20easily%20through%20the%20app.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20problem%20is%20that%20we%20ran%20into%20an%20issue%20where%20the%20app%20wasn't%20showing%20the%20whole%20list.%20I%20think%20this%20is%20because%20GroupBy%20is%20not%20a%20delegating%20function.%20But%20I%20am%20using%20GroupBy%20in%20order%20to%20show%20the%20logbooks%20at%20the%20beginning%20so%20people%20can%20access%20the%20list%20via%20the%20Logbook%20ID.%26nbsp%3B%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20666px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165124i5CC6D4EAAD7D9C19%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22VehicleHoldTimesScreenshot1.png%22%20title%3D%22VehicleHoldTimesScreenshot1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ENumber%20of%20Vehicles%20is%20basically%20how%20many%20list%20entries%20are%20in%20the%20same%20Logbook.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20code%20for%20dealing%20with%20the%20SharePoint%20list%20uses%20ClearCollect%20in%20order%20to%20use%20any%20function%20I%20need%20within%20the%20app.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EClearCollect(%0A%20%20%20%20colDatabase%2C%0A%20%20%20%20'Vehicle%20Entry%20Log'%0A)%3B%0AClearCollect(%0A%20%20%20%20colVehicleLog%2C%0A%20%20%20%20GroupBy(%0A%20%20%20%20%20%20%20%20SortByColumns(%0A%20%20%20%20%20%20%20%20%20%20%20%20colDatabase%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Created%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20Ascending%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20%20%22LogbookID%22%2C%0A%20%20%20%20%20%20%20%20%22Title%22%0A%20%20%20%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3EQuestion%201%3A%26nbsp%3B%3C%2FSTRONG%3EIs%20there%20a%20way%20to%20use%20GroupBy%20and%20other%20non-delegating%20functions%20in%20the%20app%20while%20still%20accessing%20the%20entire%20SharePoint%20List%20(instead%20of%20the%20app%20only%20collecting%20the%20first%20500%20entries%2C%20which%20is%20the%20limitation%20we%20have%20right%20now).%26nbsp%3B%3CBR%20%2F%3E%3CSTRONG%3EIf%20Not%2C%20Question%202%3A%3C%2FSTRONG%3E%20Is%20there%20a%20way%20to%20collect%20the%20most%20recent%20500%20entries%20within%20the%20list%3F%20We%20can%20deal%20with%20not%20being%20able%20to%20deal%20with%20older%20list%20entries%2C%20we%20just%20need%20it%20to%20collect%20the%20most%20recent%20items%20instead%20of%20oldest-to-newest.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1106255%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1109266%22%20slang%3D%22en-US%22%3ERe%3A%20PowerApps.%20Need%20help%20with%20using%20Collect%20for%20a%20very%20large%20Sharepoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1109266%22%20slang%3D%22en-US%22%3EWhat%20I%20do%20is%20get%20everything%20into%20local%20collection%2C%20then%20you%20can%20do%20whatever%20you%20want%20without%20worrying%20about%20delegation.%20This%20way%20you%20get%20the%20filtered%20result%20then%20you%20can%20count%20that%20result%20from%20the%20collection.%20%3CBR%20%2F%3E%3CBR%20%2F%3EMine%20is%20static%2C%20so%20I%20have%20one%20for%20each%20count%2C%20but%20if%20you%20have%20dynamic%2C%20you%20might%20look%20at%20utilizing%20a%20ForAll(assuming%20you%20have%20less%20than%202000%20logbook%20rows)%20and%20do%20a%20collect%20for%20each%20one%20into%20the%20same%20collection.%20Then%20you'll%20have%20that%20collection%20local%20to%20get%20your%20counts%20for%20your%20groupby%20or%20what%20not.%20I%20think%20this%20might%20work%20out.%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hello, 
I created an App to help workers in accessing and adding to a very large Sharepoint List. 
I organized the data by creating a new field in the list (Logbook ID). Everytime a worker creates a new Logbook ID, they can easily create new list entries with the same ID so they are able to access that set of entries easily through the app. 

The problem is that we ran into an issue where the app wasn't showing the whole list. I think this is because GroupBy is not a delegating function. But I am using GroupBy in order to show the logbooks at the beginning so people can access the list via the Logbook ID. 
VehicleHoldTimesScreenshot1.png

Number of Vehicles is basically how many list entries are in the same Logbook. 

My code for dealing with the SharePoint list uses ClearCollect in order to use any function I need within the app. 

 

 

ClearCollect(
    colDatabase,
    'Vehicle Entry Log'
);
ClearCollect(
    colVehicleLog,
    GroupBy(
        SortByColumns(
            colDatabase,
            "Created",
            Ascending
        ),
        "LogbookID",
        "Title"
    )
);

 

 


Question 1: Is there a way to use GroupBy and other non-delegating functions in the app while still accessing the entire SharePoint List (instead of the app only collecting the first 500 entries, which is the limitation we have right now). 
If Not, Question 2: Is there a way to collect the most recent 500 entries within the list? We can deal with not being able to deal with older list entries, we just need it to collect the most recent items instead of oldest-to-newest. 

1 Reply
Highlighted
What I do is get everything into local collection, then you can do whatever you want without worrying about delegation. This way you get the filtered result then you can count that result from the collection.

Mine is static, so I have one for each count, but if you have dynamic, you might look at utilizing a ForAll(assuming you have less than 2000 logbook rows) and do a collect for each one into the same collection. Then you'll have that collection local to get your counts for your groupby or what not. I think this might work out.