Showing results for 
Search instead for 
Did you mean: 
New Member

How to Default a People Picker to current user & save to SharePoint List source



I am trying to create a very simple PowerApp based on a SharePoint list.  This list has a Person field.  When I initially create the PowerApp, if the user types in a person's name and chooses one, it saves fine.  As soon as I try to default the Person field in the PowerApp to "current user" (using any of the User(). syntax options), my PowerApp stops saving back to the SharePoint source list. 


Any ideas?


Thank you! this is exactly what I needed.

In here what is this SalesPerson_DD (in red text color)?


If( Account_Detail_Edit_Display_Long_1.Mode = FormMode.New,
              Claims:"i:0#.f|membership|" & Lower(User().Email),
         }, SalesPerson_DD.Selected)

Frequent Visitor

I am looking for the Same. Is there any updates now?

RebeccaS (somewhere in this thread) helped me - I'm copying it below: 

If I want the data card to default to the current user I set a variable at the start that is = Set(_CurrentUser, User())

Then on the combo box I put as the DefaultSelectedItems: {DisplayName: _CurrentUser.FullName}
^ this does nothing but show the name so if you are hiding it then it is no necessary

Then on the cards Update value I put :

{DisplayName: _CurrentUser.FullName,
Claims:"i:0#.f|membership|" & Lower(_CurrentUser.Email),
Email: _CurrentUser.Email,
Picture:""}, ComboBox.Selected)

This is basically saying to default to the current user but if they change it then take that instead. I have seen several people say "easier" ways of doing it but I have been using this for a while and it works great...the other ways I have seen I have had trouble with them. This works 100% of the time for me.

From <>

If(DataCardValue2.Selected.DisplayName = strCurrentUser.FullName,{DisplayName: strCurrentUser.FullName, Claims:"i:0#.f|membership|" & Lower(strCurrentUser.Email),
Email: strCurrentUser.Email,
Picture:""}, DataCardValue2.Selected)

I would just change the line of DisplayName: User().Email to DisplayName: User().FullName.

Helper I
Helper I

For people still viewing this thread, unless I'm misunderstanding how the sharepoint people backend works, you actually only need the claims field to be populated, as sharepoint will automagically derive all the other properties from it.
This means (according to my quick tests) the only line you need is

{Claims:"i:0#.f|membership|" & Lower(_CurrentUser.Email)}

 Or, if you don't want to use a variable to store the current user (I wonder what the performance implications are with this, if any)

{Claims:"i:0#.f|membership|" & Lower(User().Email)}

If you need to populate a People column in SharePoint using a Power Automate flow, you're right: Claims (user's e-mail) is all you need. But when it comes to populating this column using a Power Apps app, it doesn't work because Power Apps identifies the register schema to save values to this column. When you add only Claims in a Patch, for example, red lines indicates you have an error and this error says the data source need a Record value, but with a different schema.


Sem título.png









(translation of the image above, something like: "Invalid argument type. Waiting for a Record, but with a different schema. Missing column. Your formula has a missing column 'Department' with 'Text' type. Patch function has some invalid arguments")


So, reforcing some of the right answers to this question, the right schema is: 


  Claims:"i:0#.f|membership|" & Lower(User().Email), 


While the patch function may fail without extra content, the Update function of a Data Card in a form seems to be just fine with just the claims.


I wonder, would the patch function work with empty values for every column, except claims ?

You're right, it works in Update property of the DataCard. 

I also tested Patch function leaving all properties but Claims as blank values and it worked. So, you're right again. Claims is all you need, but using Patch function, the schema must be respected, even if you leave all other properties blank.

Frequent Visitor

Just to add, for anyone that may have an issue when the people picker accepts multiple people. You need to enclose the object in a Table function

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,186)