Using Power Automate to Add Users to SharePoint Groups

Posted by

To add users to a SharePoint group via Power Automate, you will need to use an HTTP request, as there’s no built-in action in Power Automate for this specific task. Here’s a step-by-step guide on how to set it up:

You will need:

  • Group ID: The unique identifier for the SharePoint group.
  • User Email: The email address of the user you want to add to the group.

Setting Up the HTTP Request

  1. Method: Use the HTTP POST method to send your request.
  2. URI: Utilize the following endpoint to target the specific SharePoint group:_api/web/siteGroups/GetById(<groupId>)/users Replace <groupId> with the actual ID of the group.
  3. Headers: Set the headers to specify the content type:{ "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }
  4. Body: Craft the JSON body of your request to include the user’s login details:{ "__metadata": { "type": "SP.User" }, "LoginName": "i:0#.f|membership|<userEmail>" }Replace <userEmail> with the email of the user you intend to add.

Leave a Reply

Your email address will not be published. Required fields are marked *