cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

how to input into a people picker column in SharePoint from PowerApp

I have a PowerApps app that has a field that is supposed to feed into a people picker column in SharePoint online.

I have a data card for "Manager Name" ,which is a people picker column in SharePoint, the card contains a combo box.

Anon600_5-1595527838985.png

 

----------

The Combo box contains this information which allows it to search Office 365 and return a list of users. I can then choose the user from the list.

Anon600_4-1595527821028.png

 



----------
This is the information for the data card which should feed into the SharePoint column

Anon600_1-1595527766647.png

 

I'm not sure what I need to put into "default" and "update" fields which I think is where the issue is arising.

I am fairly new to PowerApps so sorry if this is an obvious question

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Office365Users.SearchUser() returns an array even if there is just one user returned.

So, you would have to use something like First(Office365Users.SearchUser({searchTerm:Combo4.Selected.Text,top:1})).DisplayName

The name of this connection Office365Users is changing to Microsoft365Users

View solution in original post

10 REPLIES 10
Highlighted
Super User III
Super User III

Change the Default formula to: Blank()

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Highlighted

Hi thank you for the reply.

 

This has not worked I tried that already I should have mentioned

 

Anon600_0-1595530703528.png

The form submits fine, but the people picker fields are blank

Highlighted

Office365Users.SearchUser() returns an array even if there is just one user returned.

So, you would have to use something like First(Office365Users.SearchUser({searchTerm:Combo4.Selected.Text,top:1})).DisplayName

The name of this connection Office365Users is changing to Microsoft365Users

View solution in original post

Highlighted

Hi Thank you for your reply. looks very promising.

I tried using 

First(Office365Users.SearchUser({searchTerm:ComboBox4.Selected.Text,top:1})).DisplayName

 

But I get error message: "The function SearchUser has some invalid arguments"

 

Any idea why this is?

 

Many thanks

Highlighted

Hello!

 

In addition to the assistance the others are giving here, it might be worth checking your update section on that Datacard, you mentioned that you are trying to fill a people picker column in SharePoint, but your update column is sending text data back,

Try changing the update column to Combobox4.Selected which should then pass an oData person object back to the column.

 

Cheers,

Sancho

 


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted

The comboBox4.Selected.Text may not be correct. 

Try testing comboBox4.Select.  and see what is in the intellisense. Hopefully, it's an email or upn value.

 

Highlighted

Thank you @iAm_ManCat  that was not something I was aware of.

 

 

@haroldbk_msftI have changed the .text to .Mail or .DisplayName and removed the .DisplayName at the end of the formula.

 

The formula now reads: First(Office365Users.SearchUser({searchTerm:Combo4.Selected.Mail,top:1}))

 

 

However I am now getting a different error 

"this rule creates a circular reference between properties, which is not allowed. A property cannot reference itself or other properties affected by its value", I'm not sure what might be causing the issue. do you have any ideas?

 

Really appreciate the help so far 🙂

 

 

Highlighted
Community Support
Community Support

Hi @Anon600 ,

 

The Update property of data card should be defined as follows.

{
Claims:"i:0#.f|membership|" & ComboBox4.Selected.UserPrincipalName,
Department:"",
DisplayName: ComboBox4.Selected.DisplayName,
Email: ComboBox4.Selected.UserPrincipalName,
JobTitle:"",
Picture:""
}

Modify the Default property of data card:

ThisItem.'Manager Name'

Modify the DefaultSelectedItems property of combobox4:

LookUp(Office365Users.SearchUser(), UserPrincipalName=ThisItem.'Manager Name'.Email)

 Hope this helps.

Sik

Highlighted

Hi @v-siky-msft,

 

I've tried the below and get error message for the Data Card Default and Update properties.

 

The error message for both is "Expected text value"

 

When I try and run the app with all of the changes the Combo Box no longer allows me to expand it and search for users.

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,834)