cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SamGibbs
Helper III
Helper III

Person picker field not saving to SharePoint

I have a simple form that includes a person picker field. The form is in 'new' mode.

 

In the person picker combo box I have set the default selected items to

 

Office365Users.SearchUser({searchTerm:HoD_email_hidden.Text})

 

HoD_email_hidden is a text input control that generates user ID numbers base on a formula.

 

The person picker correctly seems to select the required person in the person picker, but it doesn't save to sharepoint when the form is submitted.

 

When I remove the default select items it then submits correctly, but I am trying to make it so that the right person is selected automatically. Is there a way to make this work?

1 ACCEPTED SOLUTION

Accepted Solutions
SamGibbs
Helper III
Helper III

I have found a slight work around:

 

'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:Concatenate("i:0#.f|membership|",HoD_email_hidden.Text,"@email.uk"),
DisplayName:User().FullName,
//display name is set to current user, however the correct email is being submitted to sharepoint
Email:Concatenate(HoD_email_hidden.Text,"@email.uk")

 

The only slight issue is that I can't seem to get the display name to show correctly. This is worked around as once it is auto-selecting it doesn't need to be on screen so I have hidden it.

 

However, if there is a better way I would still be interested!

View solution in original post

3 REPLIES 3
SamGibbs
Helper III
Helper III

I have found a slight work around:

 

'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:Concatenate("i:0#.f|membership|",HoD_email_hidden.Text,"@email.uk"),
DisplayName:User().FullName,
//display name is set to current user, however the correct email is being submitted to sharepoint
Email:Concatenate(HoD_email_hidden.Text,"@email.uk")

 

The only slight issue is that I can't seem to get the display name to show correctly. This is worked around as once it is auto-selecting it doesn't need to be on screen so I have hidden it.

 

However, if there is a better way I would still be interested!

View solution in original post

v-albai-msft
Community Support
Community Support

Hi @SamGibbs ,

Seems the HoD_email_hidden shows the DisplayName of user.

If so, you can try this formula on DefaultSelectedItems property:

 

{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName:LookUp(Office365Users.SearchUser({top:999}),DisplayName=HoD_email_hidden.Text).DisplayName,
Claims:"i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser({top:999}),DisplayName=HoD_email_hidden.Text).Mail),
Department:"",
Email:LookUp(Office365Users.SearchUser({top:999}),DisplayName=HoD_email_hidden.Text).Mail,
JobTitle:"",
Picture:""
}

 

Notes:

1. You should pay attention to the uppercase and lowercase of the HoD_email_hidden value, space between displayName will also get a no match result. 

2. If HoD_email_hidden returns other property like ID, you need to edit formula to meet your own requirement.

Best regards,

Allen

Hi, thanks for responding. The 'HoD_email_hidden' is a using an if statement to find the correct ID number for the relevant user. This information is not set up within our office 365 users list. Plus we have well over 10000 entries in the users list so the formula desn't seem to work. Can it be adjusted to use the SearchUser({searchterm})? I tried but it didnt seem to work.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,276)