web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / store user() to ShareP...
Power Apps
Answered

store user() to SharePoint list person column

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

 

 

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi tChmiel,

     

    According to your description, I created a similar SharePoint list with you, say ListC.
    Then created a connection from PowerApps to this list.
    On the app, I configured the OnVisible property of the screen as:

    If(User().FullName in ListC.Title,UpdateIf(ListC,Title=User().FullName,{LastTime:Now(),euru:euru+1}),Patch(ListC,Defaults(ListC),{Title:User().FullName,LastTime:Now(),euru:0}))

    When I navigate to this screen, the item would be updated or a new item would be created.

     

    PS: About Usage column, it was named as “Usage” in the list, but on the app, I was asked to use the name “euru”. So please make sure you were using the valid column name.

     

    Hope my code could be a reference for you. And these documentations for your reference:
    https://powerapps.microsoft.com/en-us/tutorials/function-if/
    https://powerapps.microsoft.com/en-us/tutorials/control-screen/


    Best regards,
    Mabel Mao

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard