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!

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,468)