cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to patch SharePoint Group in person and group field?

Hi I want to add SharePoint Group in person and group field using Patch() function? Any ideas hos to do it?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: How to patch SharePoint Group in person and group field?

@v-yutliu-msft @Pstork1 

 

Thank you guys, I got it working. In claim we have to just mentioned SharePoint group name.

 

Set(SearchGroup,{
Claims: "dev Members",
Department:"",
DisplayName:"dev Members",
Email:"",
JobTitle:"",
Picture:""
});
Patch(TestList,Defaults(TestList),{Title:"Test",PersonField:SearchGroup});

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: How to patch SharePoint Group in person and group field?

Assuming the column is set for Multiple entries you would use code like this:

Patch(
    'Expense Reports',
    Defaults('Expense Reports'),
    {
        Title: "test",
        Approvers: Table(
            {
                Claims: "c:0o.c|federateddirectoryclaimprovider|6c2b508e-b774-44ca-859c-de8ce7be96b4",
                DisplayName: "FlowDemos Members",
                Email: "",
                Picture: "",
                Department: "",
                JobTitle: ""
            }
        )
    }
)

The Claims entry is the same for every group, except for the GUID at the end.  That is the ID for the Group.  display Name is the Display name.  Just leave the other entries blank.  Otherwise its just like a Person entry, just with a different Claims value.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: How to patch SharePoint Group in person and group field?

@Pstork1 How can I find GUID of a SharePoint Group in SharePoint online?

Highlighted
Community Support
Community Support

Re: How to patch SharePoint Group in person and group field?

Hi @PawanS ,

Do you want to update a sharepoint person field with a sharepoint group?

I'm afraid it's not supported to use the sharepoint group in sharepoint person field.

Currently, sharepoint person field could only get data from azureAD, which means that it only supports office365 group and office365 users.

If you patch person data to this field you could try this formula:

{Claims: "i:0#.f|membership|" & email address;    
                            DisplayName: fullname;
                            Email: email address;
                            Department: "";
                            JobTitle: "";
                            Picture: ""
}

If you patch group data to this field you could try this formula:

{Claims: "c:0o.c|federateddirectoryclaimprovider|" & groupid
                            DisplayName: groudisplayName;
                            Email: groupemail;
                            Department: "";
                            JobTitle: "";
                            Picture: ""
                        }

You could get groupid by using Office365Group connector.

Try this formula:

LookUp(Office365Groups.ListOwnedGroupsV2().value, displayName = groupdisplayname).id
//please replace groupdisplayname with the name that you want

So if you want to add a group in this field, I suggest you create a office365 group with the same users that your sharepoint group has. And then update with this office365 group.

You could create a office365 group in azure admin center.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: How to patch SharePoint Group in person and group field?

@v-yutliu-msftI am able to add SharePoint Group if I use default SharePoint form. Also if I customize form in powerapp, in that form also I am able to search SharePoint group and save data in a list.

 

In my case, I am creating canvas app, in which I am using patch function to save data in a list, and I am not sure how should I pass SharePoint Group in it. Is it not possible in patch?

 

 

 

Highlighted
Frequent Visitor

Re: How to patch SharePoint Group in person and group field?

@v-yutliu-msft @Pstork1 

 

Thank you guys, I got it working. In claim we have to just mentioned SharePoint group name.

 

Set(SearchGroup,{
Claims: "dev Members",
Department:"",
DisplayName:"dev Members",
Email:"",
JobTitle:"",
Picture:""
});
Patch(TestList,Defaults(TestList),{Title:"Test",PersonField:SearchGroup});

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,203)