cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power_Robert
Helper II
Helper II

Patch People and Groups LookUp column explained?

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!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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]):

Capture.PNG

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. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,762)