Hi,
Can someone please direct me to an article that explains how to patch a People and Groups LookUp column? I've been looking for it but I don't fully get the "Claims" part. What does it do/is it for?
Lets say you have the Patch part of a People and Groups LookUp column. It could look like this:
PersonLkp: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|johndoe@domain.com,
Department: "",
DisplayName: "John Doe",
Email: "johndoe@domain.com",
JobTitle: "Not sure",
Picture: ""
}
What exactly is the Claims value made of? Whats email address do you user here? The one from the end user or the one from the selected record in for example a Combo Box?
Thanks for any help!
Solved! Go to Solution.
Hi @Power_Robert ,
Based on the issue that you mentioned, I think you have some misunderstanding with the Claim attribute of Person type field in SP List.
The email address you included within Claim attribute should be same with that you assigned to the Email attribute. The standard formula structure for the Person field in Patch function should like below:
Patch(
'SP List',
Defaults('SP List'),
{
...,
PersonField: {
Claims: "i:0#.f|membership|" & Lower("user@email.com"),
DisplayName: "Display Name",
Email: "user@email.com",
Department: "",
JobTitle: "",
Picture: ""
},
...
}
)
Note: The email address you included within the Claim attribute should be in Lower case.
Actually, the email address within the Claim attribute should be consistent as that you assigned to the Email attribute. And the email address is based on which user you want to assign to this Person field rather than the email address of end user or the selected record in the ComboBox.
Of course, if the ComboBox is connected to a Person field in your SP list, and you want to select person option from this ComoBox, you could reference the email address, displayname, .. of the selected Person option from the ComboBox using the following formula:
ComboBox1.Selected.Email // Reference Email address of selected person
ComboBox1.Selected.DisplayName // Reference DisplayName of selected Person
Note: The Items property of the ComboBox is set to following:
Choices('SP List'.PersonField)
Best regards,
Hi @Power_Robert ,
Based on the issue that you mentioned, I think you have some misunderstanding with the Claim attribute of Person type field in SP List.
The email address you included within Claim attribute should be same with that you assigned to the Email attribute. The standard formula structure for the Person field in Patch function should like below:
Patch(
'SP List',
Defaults('SP List'),
{
...,
PersonField: {
Claims: "i:0#.f|membership|" & Lower("user@email.com"),
DisplayName: "Display Name",
Email: "user@email.com",
Department: "",
JobTitle: "",
Picture: ""
},
...
}
)
Note: The email address you included within the Claim attribute should be in Lower case.
Actually, the email address within the Claim attribute should be consistent as that you assigned to the Email attribute. And the email address is based on which user you want to assign to this Person field rather than the email address of end user or the selected record in the ComboBox.
Of course, if the ComboBox is connected to a Person field in your SP list, and you want to select person option from this ComoBox, you could reference the email address, displayname, .. of the selected Person option from the ComboBox using the following formula:
ComboBox1.Selected.Email // Reference Email address of selected person
ComboBox1.Selected.DisplayName // Reference DisplayName of selected Person
Note: The Items property of the ComboBox is set to following:
Choices('SP List'.PersonField)
Best regards,
Thanks @v-xida-msft !
This helps a lot!
Can you please also explain the part below? Or refer to documentation?
i:0#.f|membership|
Of course, if the ComboBox is connected to a Person field in your SP list, and you want to select person option from this ComoBox, you could reference the email address, displayname, .. of the selected Person option from the ComboBox using the following formula:
ComboBox1.Selected.Email // Reference Email address of selected person
ComboBox1.Selected.DisplayName // Reference DisplayName of selected Person
Note: The Items property of the ComboBox is set to following:
Choices('SP List'.PersonField)
Best regards,
Hi @v-xida-msft,
After some stubborn issues with my app that I was not able to open anymore, I was finally able to have a better look at the above.
I've tried to set the Items property as you described, but this doesn't work for me (same without quotes or using [@MTRequest_Doctor]):
But as you can see, the attributes are there to select. But the combo box is empty.
What I have now is this and is ok, to show the Items in the combo box:
Distinct(
MTRequest_Doctor,
PersonLkp.DisplayName
)
In the patch function I use this:
ApproveFormByDoctorLkp: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & cbValueByDoctor.Selected.Result,
Department: "",
DisplayName: "",
Email: "",
JobTitle: "",
Picture: ""
}
Where the cbValueByDoctor.Selected.Result returns the display name and it does work. So I am still wondering what the real definition is/requirements are for the claims attribute.
User | Count |
---|---|
180 | |
114 | |
88 | |
44 | |
42 |
User | Count |
---|---|
226 | |
113 | |
112 | |
69 | |
67 |