Hello,
Has anyone created or does anyone could be so kind to share with me what could be the most efficient way to develop my app logic to track the individual user progress throughout the app?
As of now, I've been thinking on creating a SharePoint list that will contain many fields (all single line text):
LastName
FirstName
CourseID
CourseDescription
FirstGrade
SecondGrade
ThirdGrade
FourthGrade
TotalGrade
ParticipationGrade
TeamworkGrade
TrainingGrade
FinalGrade
userEmail
ActivityDateTime
My logic on AppStart is to:
Set(varUserEmail, Lower(User().Email));
Set(varUserLastName, Office365Users.MyProfileV2().surname);
Set(varUserFirstName, Office365Users.MyProfileV2().givenName);
And then on the click of a button in the first main/welcome screen, the OnSelect logic is:
Patch(SPTrainee, Defaults(SPTrainee), {LastName:varUserLastName,FirstName:varUserFirstName,FirstGrade:"0",userEmail:varUserEmail,ActivityDateTime:Now(),CourseID:"1",CourseDescription:btnMainScreen.Text});Navigate(NextScreen,Cover)
This is the first time I am trying to code a user progress tracking session, and I am not certain this is the best way to approach this. Could anyone be so kind to share any guidance on the best way to approach this? basically the intention is to track all the changes that the user will be performing while using (this changes or actions should have an associated score which I am not certain how to implement without thinking on doing this for each element which would be tremendously time consuming if I write the formula for every single checkbox element) to later visualize a final score, associated with to each user. Also, the intention should be to track the user usedTime to complete an specific action, for this I would require to save the time every time the user checks that something has been completed (in a checkbox list), finally I am not sure if this logic should update a single record line for each user, instead of having multiple rows of data associated to a single user. (to me, the second feels like the SharePoint datasource will be overloaded very soon and make the app perform slowly).
Appreciate your assitance.
Thank you.
You are correct that SharePoint has the potential to become overloaded, but this depends on the volume of your data. How many users do you expect to be using the app (i.e. rows in the SharePoint list, at least 1 per user)?
A few design notes:
This give you some flexibility to bind your controls to the gblUserRecord variable for visualizing things as you go. Alternatively, it'll be the colUserRecord's single record value. Either way, this will give you the persistence you need to show the user things in the app and then a way to update any changes back to your centralized list.
It's not discussed here, but you may want to consider multiple lists (refactor the data model), instead of columns. Crude example below. You may be able to get away with a single list, but obviously it becomes more cumbersome and rigid the more you use columns instead of a data model.
Hello @GarethPrisk
Thanks for your response, I've been implementing this today and it is helping me a lot, but I got an error, if you happen to know what this error is all about and how to fix it, that'd be a great help.
What I did so far:
On App OnStart:
Set(varUserEmail, Lower(User().Email));
Set(globalUserRecord, LookUp(SPTrainee, userEmail=varUserEmail));
If(IsBlank(globalUserRecord), Set(globalUserRecord, Patch(SPTrainee, Defaults(SPTrainee), {LastName:varUserLastName, FirstName:varUserFirstName,FirstGrade:"0",userEmail:varUserEmail,ActivityDateTime:Now()})));
ClearCollect(colUserRecord, globalUserRecord);
Above is working great, it is creating a single user row, per user.
Then, in the first screen the user sees, I will start collecting some data based on the user interaction with the app, for instance, I will first collect the button text to insert that piece as the Course Description when the button is pressed.
OnSelect of a button:
UpdateIf(colUserRecord,true,{CourseDescription:btnMain.Text}));
Set(globalUserRecord,First(colUserRecord));
Patch(SPTrainee, LookUp(SPTrainee, userEmail=varUserEmail),globalUserRecord);
Navigate(Onboarding, ScreenTransition.Cover);
Up to this point, everything is working OK. Then in the next screen (Onboarding), I would like to start collecting the user score, based on some checkboxes selection. I have the following in the OnSelect property:
ClearCollect(colUserRecord,globalUserRecord);
If(chkCheckMark.Value=true,Set(Score,Score+1),Set(Score,Score-1));
UpdateIf(colUserRecord,true,{FirstGrade:Score});
Set(globalUserRecord,First(colUserRecord));
Patch(SPTrainee, LookUp(SPTrainee, userEmail=varUserEmail), globalUserRecord); //This one has the red line below it, giving the error "{VersionNumber}: The specified column is read-only and can't be modified."
I am getting an error which says {VersionNumber}: The specified column is read-only and can't be modified and I can't figure out what I am doing incorrectly.
Appreciate any assistance.
Thank you!
User | Count |
---|---|
257 | |
110 | |
90 | |
51 | |
44 |