hey guys,
I have created an app for tracking steps and presenting the data on a leader board. The solution is driven from a SharePoint List where steps entries are recorded.
The app has been a lot more successful than originally planned, which has lead us to this point where we have over 2000 entries, which has caused issues with retrieving and calculating the total steps by user to present on the leaderboard
Originally the below code was used to pull through and the total steps, grouped by user and present a leader board via a vertical gallery. This worked perfectly up to the 2000 data row limit.
Sort(
AddColumns(
GroupBy(
WellbeingStepsChallenge_StepsLog,
"UserEmail","UserDisplayName",
"Steps"
),
"TotalSteps",
Sum(
Steps,
Steps
)
),
TotalSteps,
Descending
)
TotalSteps,
Descending
),UserEmail = User().Email
)
To resolve the issue, I am attempting to implement a solution provided by PAUL RODRIGUES (@ https://officepoweruser.com/how-to-collect-over-2000-records-in-powerapps/). However, I cant see to integrate the below section of code into the formula
ClientID = varClientID && ID > varIDForNextTransRun
The below formula is an attempt, while it doesn't present any errors, it also doesn't retrieve the correct 'total steps' grouped by user Email. I understand that I have missed out the 'ClientID = varClientID && ID > varIDForNextTransRun' variable, to calculate the next collect position, however I need some guidance on how to implement this into my code.
Set(varUserEmail, User().Email); ClearCollect(
StepsLogVar,
Sort(
AddColumns(
GroupBy(
WellbeingStepsChallenge_StepsLog,
"UserEmail","UserDisplayName",
"Steps", "ID"
),
"TotalSteps",
Sum(
Steps,
Steps
)
),
TotalSteps,
Descending
)
);If(
CountRows(StepsLogVar) = 2000,
Set(
varIDForNextTransRun, // Set this variable to get a the last ID saved into the collection.
2001
);
Collect(
StepsLogVar,
Sort(
Filter(
AddColumns(
GroupBy(
WellbeingStepsChallenge_StepsLog,
"UserEmail","UserDisplayName",
"Steps", "ID"
),
"TotalSteps",
Sum(
Steps,
Steps
)
),
TotalSteps,
Descending),
varIDForNextTransRun = 4001
))
);
See attached for the data source columns

Alternatively, if there are better solutions to this issue, then I welcome the advice
Thank you in advance for your help!