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
- Method: Use the HTTP
POST
method to send your request. - 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. - Headers: Set the headers to specify the content type:
{ "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }
- 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.
