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?
Solved! Go to Solution.
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!
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!
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.
User | Count |
---|---|
256 | |
103 | |
92 | |
47 | |
37 |