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 / PowerApps People picke...
Power Apps
Answered

PowerApps People picker - Current User

(0) ShareShare
ReportReport
Posted on by 34

I have a people picker field in the SharePoint list and I am displaying that in PowerApps in New Form. Users should be able to enter user name and submit the form. It is working as expected.

 

Also, I would like this people picker to show current user name by default when new form shows up and if user doesn't change this in the people picker, it should just save current user name in the people field in SharePoint. I know that I can display current user by User().DisplayName but I am not sure where to put that. I have tried adding it in the Default property but that is not working. It is giving an error property expects record value but this produces a text value. 

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    Try this code in the default property of the data card associated with the people picker field. You will also need to change the PeoplePicker in the last line to the name of your people picker field.

     

    If(SharePointForm1.Mode = New,{
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:Concatenate("i:0#.f|membership|",Office365Users.Manager(User().Email).Mail),
     DisplayName:Office365Users.Manager(User().Email).DisplayName,
     Email:Office365Users.Manager(User().Email).Mail
     }, 
    ThisItem.PeoplePicker)

     

    Why do smiley faces keep showing up and do you stop it.  Where ever you see a smiley face replace it with ":" and "O"

  • Sienna Profile Picture
    1,532 on at
    😆 @Jeff_Thorpe
    There is setting under your account to stop the smiley faces show up. But I think that should be set as default not to show these faces.. Specialy in the code. Tag someone who is resposible for this to fix it. It is really annoying
  • Dvictor881 Profile Picture
    34 on at

    Thanks for replying. I haven't tried it yet but just by reading it, it looks like it is checking if the form is new show current user managers information otherwise show people picker. Is that correct?

     

    Basically, I only have new form and no other form. In New form itself, I want default to be current user name and user should have ability to change that to some other name and that's where people picker shows up. 

     

     

  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    @Dvictor881,

     

    Sorry for the confusion. It looks like I gave you my manager lookup formula. It is checking to see if it is a new form and if so, setting the default value to the current user's manager. The user can still change the value if needed. I have updated the code to display the current user instead of manager.

     

    If(EditForm2.Mode = New,{
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims:Concatenate("i:0#.f|membership|",User().Email),
     DisplayName:User().FullName,
     Email:User().Email
     }, 
    ThisItem.PersonGroup)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    @Sienna,

     

    Thanks for the tip on the smile setting and I have turned it off. I agree it should be off by default or at the very least it should display in code box.

  • Dvictor881 Profile Picture
    34 on at

    Thanks for the help. It worked perfectly. I have included this code in the DefaultSelectedItems property and it is behaving as expected. Thanks again. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Is this still the only way to get the current user pre-selected in a people picker drop-down? If so, is there a way to use the selected user information to then populate an email field (single line of text field)?

     

    Thanks!

    H

     

     

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    @Anonymous

    Since email is property of the selected person record in the people picker you can get the email address and display it in a text field. If the people picker was single select and in a combo box called DataCardValue1 the formula would look like this:

     

    DataCardValue1.Selected.Email
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Fabulous! Thanks!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for this answer! 

     

    I just wanted to extend this one more step. Is there a way to gather the existing selected users in a people picker field and add the currently logged in user? By using the above code I can get my own name to populate in a powerapps form but it erases all of the existing names. If i replace the above with Parent.Default the form will populate with the existing selected names.

     

    Is there an easy way to add the currently logged in user to the Parent.Default?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard