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

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,956)