I am trying to record the current user, how many times he/she used the app, and the last time he utilitzed the app.
My SPO List:
AppUser (Title:Text Person:PeoplePicker Usage:Int LastUsed:Date)
And I currently have it implemented like this:
Screen.OnVisible
Patch(AppUsers, Defaults(AppUsers), {Title:User().Email, LastUsed:Now(), Usage:0})
Button.OnSelect
UpdateIf(AppUsers, Title = User().Email, {Title:User().Email, LastUsed:Today(), Usage:Usage+1})
Two questions:
1. How can I use the User() to populate the "Person" field in the SharePoint List?
2. How can I combine both actions above into one?
ie( Check if User() is not in the list, add the user to list and set his usage to 1, else increment the usage by 1.
This syntax does not work:
Patch(AppUsers, Defaults(AppUsers), {Title:User().Email, LastUsed:Now(), Usage:Usage+1}
Thanks.
Tom

Report
All responses (
Answers (