cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted

Thanks @v-xida-msft !

 

This helps a lot!

 

Can you please also explain the part below? Or refer to documentation?

i:0#.f|membership|

 

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,659)