I have code to load 1 lakh items from a SharePoint online list, but it takes about 15 seconds to load.
I tried commented section code as well, but that also takes the same time.
//My Visitors from AllVisitors list
Clear(collMyVisitors);
With(
{
_Sets:
With(
{
_Limits:
With(
{
_Limit:
Sort(
AllVisitors,
Indexed_ID,
SortOrder.Descending
)
},
RoundDown(
First(_Limit).Indexed_ID / 2000,
0
) + 1
)
},
AddColumns(
RenameColumns(
Sequence(
_Limits,
0,
2000
),
Value,
LowID
),
HighID,
LowID + 2000
)
)
},
ForAll(
_Sets As _MaxMin,
Collect(
collMyVisitors,
Sort(
Filter(
AllVisitors,
Indexed_ID > _MaxMin.LowID && Indexed_ID <= _MaxMin.HighID
&& Requestor.Email = User().Email), Indexed_ID, SortOrder.Ascending)
)
)
);
/*
Concurrent(
ClearCollect(tempMyVisitors1, Filter('AllVisitors', Indexed_ID <= startIndex_ID + 2000)),
ClearCollect(tempMyVisitors2, Filter('AllVisitors', Indexed_ID > startIndex_ID + 2000 && Indexed_ID <= startIndex_ID + 4000)),
ClearCollect(tempMyVisitors3, Filter('AllVisitors', Indexed_ID > startIndex_ID + 4000 && Indexed_ID <= startIndex_ID + 6000)),
ClearCollect(tempMyVisitors4, Filter('AllVisitors', Indexed_ID > startIndex_ID + 6000 && Indexed_ID <= startIndex_ID + 8000)),
ClearCollect(tempMyVisitors5, Filter('AllVisitors', Indexed_ID > startIndex_ID + 8000 && Indexed_ID <= startIndex_ID + 10000)),
ClearCollect(tempMyVisitors6, Filter('AllVisitors', Indexed_ID > startIndex_ID + 10000 && Indexed_ID <= startIndex_ID + 12000)),
ClearCollect(tempMyVisitors7, Filter('AllVisitors', Indexed_ID > startIndex_ID + 12000 && Indexed_ID <= startIndex_ID + 14000)),
ClearCollect(tempMyVisitors8, Filter('AllVisitors', Indexed_ID > startIndex_ID + 14000 && Indexed_ID <= startIndex_ID + 16000)),
ClearCollect(tempMyVisitors9, Filter('AllVisitors', Indexed_ID > startIndex_ID + 16000 && Indexed_ID <= startIndex_ID + 18000)),
ClearCollect(tempMyVisitors10, Filter('AllVisitors', Indexed_ID > startIndex_ID + 18000 && Indexed_ID <= startIndex_ID + 20000)),
ClearCollect(tempMyVisitors11, Filter('AllVisitors', Indexed_ID > startIndex_ID + 20000 && Indexed_ID <= startIndex_ID + 22000)),
ClearCollect(tempMyVisitors12, Filter('AllVisitors', Indexed_ID > startIndex_ID + 22000 && Indexed_ID <= startIndex_ID + 24000)),
ClearCollect(tempMyVisitors13, Filter('AllVisitors', Indexed_ID > startIndex_ID + 24000 && Indexed_ID <= startIndex_ID + 26000)),
ClearCollect(tempMyVisitors14, Filter('AllVisitors', Indexed_ID > startIndex_ID + 26000 && Indexed_ID <= startIndex_ID + 28000)),
ClearCollect(tempMyVisitors15, Filter('AllVisitors', Indexed_ID > startIndex_ID + 28000 && Indexed_ID <= startIndex_ID + 30000)),
ClearCollect(tempMyVisitors16, Filter('AllVisitors', Indexed_ID > startIndex_ID + 30000 && Indexed_ID <= startIndex_ID + 32000)),
ClearCollect(tempMyVisitors17, Filter('AllVisitors', Indexed_ID > startIndex_ID + 32000 && Indexed_ID <= startIndex_ID + 34000)),
ClearCollect(tempMyVisitors18, Filter('AllVisitors', Indexed_ID > startIndex_ID + 34000 && Indexed_ID <= startIndex_ID + 36000)),
ClearCollect(tempMyVisitors19, Filter('AllVisitors', Indexed_ID > startIndex_ID + 36000 && Indexed_ID <= startIndex_ID + 38000)),
ClearCollect(tempMyVisitors20, Filter('AllVisitors', Indexed_ID > startIndex_ID + 38000 && Indexed_ID <= startIndex_ID + 40000)),
ClearCollect(tempMyVisitors21, Filter('AllVisitors', Indexed_ID > startIndex_ID + 40000 && Indexed_ID <= startIndex_ID + 42000)),
ClearCollect(tempMyVisitors22, Filter('AllVisitors', Indexed_ID > startIndex_ID + 42000 && Indexed_ID <= startIndex_ID + 44000)),
ClearCollect(tempMyVisitors23, Filter('AllVisitors', Indexed_ID > startIndex_ID + 44000 && Indexed_ID <= startIndex_ID + 46000)),
ClearCollect(tempMyVisitors24, Filter('AllVisitors', Indexed_ID > startIndex_ID + 46000 && Indexed_ID <= startIndex_ID + 48000)),
ClearCollect(tempMyVisitors25, Filter('AllVisitors', Indexed_ID > startIndex_ID + 48000 && Indexed_ID <= startIndex_ID + 50000)),
ClearCollect(tempMyVisitors26, Filter('AllVisitors', Indexed_ID > startIndex_ID + 50000 && Indexed_ID <= startIndex_ID + 52000)),
ClearCollect(tempMyVisitors27, Filter('AllVisitors', Indexed_ID > startIndex_ID + 52000 && Indexed_ID <= startIndex_ID + 54000)),
ClearCollect(tempMyVisitors28, Filter('AllVisitors', Indexed_ID > startIndex_ID + 54000 && Indexed_ID <= startIndex_ID + 56000)),
ClearCollect(tempMyVisitors29, Filter('AllVisitors', Indexed_ID > startIndex_ID + 56000 && Indexed_ID <= startIndex_ID + 58000)),
ClearCollect(tempMyVisitors30, Filter('AllVisitors', Indexed_ID > startIndex_ID + 58000 && Indexed_ID <= startIndex_ID + 60000)),
ClearCollect(tempMyVisitors31, Filter('AllVisitors', Indexed_ID > startIndex_ID + 60000 && Indexed_ID <= startIndex_ID + 62000)),
ClearCollect(tempMyVisitors32, Filter('AllVisitors', Indexed_ID > startIndex_ID + 62000 && Indexed_ID <= startIndex_ID + 64000)),
ClearCollect(tempMyVisitors33, Filter('AllVisitors', Indexed_ID > startIndex_ID + 64000 && Indexed_ID <= startIndex_ID + 66000)),
ClearCollect(tempMyVisitors34, Filter('AllVisitors', Indexed_ID > startIndex_ID + 66000 && Indexed_ID <= startIndex_ID + 68000)),
ClearCollect(tempMyVisitors35, Filter('AllVisitors', Indexed_ID > startIndex_ID + 68000 && Indexed_ID <= startIndex_ID + 70000)),
ClearCollect(tempMyVisitors36, Filter('AllVisitors', Indexed_ID > startIndex_ID + 70000 && Indexed_ID <= startIndex_ID + 72000)),
ClearCollect(tempMyVisitors37, Filter('AllVisitors', Indexed_ID > startIndex_ID + 72000 && Indexed_ID <= startIndex_ID + 74000)),
ClearCollect(tempMyVisitors38, Filter('AllVisitors', Indexed_ID > startIndex_ID + 74000 && Indexed_ID <= startIndex_ID + 76000)),
ClearCollect(tempMyVisitors39, Filter('AllVisitors', Indexed_ID > startIndex_ID + 76000 && Indexed_ID <= startIndex_ID + 78000)),
ClearCollect(tempMyVisitors40, Filter('AllVisitors', Indexed_ID > startIndex_ID + 78000 && Indexed_ID <= startIndex_ID + 80000)),
ClearCollect(tempMyVisitors41, Filter('AllVisitors', Indexed_ID > startIndex_ID + 80000 && Indexed_ID <= startIndex_ID + 82000)),
ClearCollect(tempMyVisitors42, Filter('AllVisitors', Indexed_ID > startIndex_ID + 82000 && Indexed_ID <= startIndex_ID + 84000)),
ClearCollect(tempMyVisitors43, Filter('AllVisitors', Indexed_ID > startIndex_ID + 84000 && Indexed_ID <= startIndex_ID + 86000)),
ClearCollect(tempMyVisitors44, Filter('AllVisitors', Indexed_ID > startIndex_ID + 86000 && Indexed_ID <= startIndex_ID + 88000)),
ClearCollect(tempMyVisitors45, Filter('AllVisitors', Indexed_ID > startIndex_ID + 88000 && Indexed_ID <= startIndex_ID + 90000)),
ClearCollect(tempMyVisitors46, Filter('AllVisitors', Indexed_ID > startIndex_ID + 90000 && Indexed_ID <= startIndex_ID + 92000)),
ClearCollect(tempMyVisitors47, Filter('AllVisitors', Indexed_ID > startIndex_ID + 92000 && Indexed_ID <= startIndex_ID + 94000)),
ClearCollect(tempMyVisitors48, Filter('AllVisitors', Indexed_ID > startIndex_ID + 94000 && Indexed_ID <= startIndex_ID + 96000)),
ClearCollect(tempMyVisitors49, Filter('AllVisitors', Indexed_ID > startIndex_ID + 96000 && Indexed_ID <= startIndex_ID + 98000)),
ClearCollect(tempMyVisitors50, Filter('AllVisitors', Indexed_ID > startIndex_ID + 98000 && Indexed_ID <= startIndex_ID + 100000))
);
// 🔹 Merge all into one collection
ClearCollect(
collMyVisitors,
tempMyVisitors1,tempMyVisitors2,tempMyVisitors3,tempMyVisitors4,tempMyVisitors5,tempMyVisitors6,
tempMyVisitors7,tempMyVisitors8,tempMyVisitors9,tempMyVisitors10,tempMyVisitors11,tempMyVisitors12,
tempMyVisitors13,tempMyVisitors14,tempMyVisitors15,tempMyVisitors16,tempMyVisitors17,tempMyVisitors18,
tempMyVisitors19,tempMyVisitors20,tempMyVisitors21,tempMyVisitors22,tempMyVisitors23,tempMyVisitors24,
tempMyVisitors25,tempMyVisitors26,tempMyVisitors27,tempMyVisitors28,tempMyVisitors29,tempMyVisitors30,
tempMyVisitors31,tempMyVisitors32,tempMyVisitors33,tempMyVisitors34,tempMyVisitors35,tempMyVisitors36,
tempMyVisitors37,tempMyVisitors38,tempMyVisitors39,tempMyVisitors40,tempMyVisitors41,tempMyVisitors42,
tempMyVisitors43,tempMyVisitors44,tempMyVisitors45,tempMyVisitors46,tempMyVisitors47,tempMyVisitors48,
tempMyVisitors49,tempMyVisitors50
);
// 🔹 Clean up temporary collections
Concurrent(
Clear(tempMyVisitors1), Clear(tempMyVisitors2), Clear(tempMyVisitors3), Clear(tempMyVisitors4), Clear(tempMyVisitors5),
Clear(tempMyVisitors6), Clear(tempMyVisitors7), Clear(tempMyVisitors8), Clear(tempMyVisitors9), Clear(tempMyVisitors10),
Clear(tempMyVisitors11), Clear(tempMyVisitors12), Clear(tempMyVisitors13), Clear(tempMyVisitors14), Clear(tempMyVisitors15),
Clear(tempMyVisitors16), Clear(tempMyVisitors17), Clear(tempMyVisitors18), Clear(tempMyVisitors19), Clear(tempMyVisitors20),
Clear(tempMyVisitors21), Clear(tempMyVisitors22), Clear(tempMyVisitors23), Clear(tempMyVisitors24), Clear(tempMyVisitors25),
Clear(tempMyVisitors26), Clear(tempMyVisitors27), Clear(tempMyVisitors28), Clear(tempMyVisitors29), Clear(tempMyVisitors30),
Clear(tempMyVisitors31), Clear(tempMyVisitors32), Clear(tempMyVisitors33), Clear(tempMyVisitors34), Clear(tempMyVisitors35),
Clear(tempMyVisitors36), Clear(tempMyVisitors37), Clear(tempMyVisitors38), Clear(tempMyVisitors39), Clear(tempMyVisitors40),
Clear(tempMyVisitors41), Clear(tempMyVisitors42), Clear(tempMyVisitors43), Clear(tempMyVisitors44), Clear(tempMyVisitors45),
Clear(tempMyVisitors46), Clear(tempMyVisitors47), Clear(tempMyVisitors48), Clear(tempMyVisitors49), Clear(tempMyVisitors50)
);
*/