cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bdc604
Advocate III
Advocate III

Flow to add user to old school SP People and Groups using REST API?

Has anyone had any luck adding user to an old school People and Groups with Flow?

 

I'm assuming all the connectors for Azure and O365 focus on Office 365 groups, not permission groups. Google is clogged with results for Office 365 groups, so not having any luck there.

 

Am thinking HTTP request and SharePoint REST API:

https://msdn.microsoft.com/en-us/library/office/dn531432.aspx?f=255&MSPPError=-2147217396#bk_UserCol...

 

POST request example: Add a user to a group

  url: "<app web url>/_api/SP.AppContextSite(@target)/web
    /sitegroups(7)/users
    ?@target='<host web url>'",
  method: "POST",
  body: "{ '__metadata': { 'type': 'SP.User' }, 'LoginName':'i:0#.w|domain\\user' }",
  headers: {
    "accept": "application/json; odata=verbose",
    "content-type": "application/json; odata=verbose"

 

group.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bdc604
Advocate III
Advocate III

less painful than i thought it would be:

 

addusertogroup.PNG

View solution in original post

5 REPLIES 5
bdc604
Advocate III
Advocate III

less painful than i thought it would be:

 

addusertogroup.PNG

View solution in original post

So what user is added with this flow? 

Is it connected to a list, or the user that creates an item?

How to connect this action with a contact list and add a member by his email address (when an item is created) in the permission group?

Hi All,

 

I am able to add the user to to SP Group using flow, how to remove user from the SP group using flow please help me 

Can you please let me know how you added users to group through flow



 

ericonline
Community Champion
Community Champion

@bdc604 ,

What is in the LoginName variable?

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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,052)