web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding multiple users ...
Power Automate
Suggested Answer

Adding multiple users to SharePoint Group using rest api with Power automate

(0) ShareShare
ReportReport
Posted on by 14
t adds the first user SoI'm using power automate to add users to a patcicular SharePoint group. Somtimes it adds the user sometimes it doesn't.
Is this api reliable or can it only add one user at a time?
The api i'm using is (Leveraging Send an HTTP request to SharePoint). See below
 
_api/web/sitegroups/getbyname('SharePoint Group')/users

Method : Post
Body :{ 
"__metadata": { "type": "SP.User" }, 
"LoginName": "i:0#.f|membership|Usersemailaddress" 
}
 
Are there any api to do this?
Thanks in advance

FYI - in my power automate the rest call is in side an Apply each and adds the users in the loop one at a time.Sometimes it adds the first user only or the last one
Categories:
I have the same question (0)
  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at
    When you click through each iteration of the loop in the run history, do you see any error responses from the API  for the ones that didn't work?
  • PI-28080747-0 Profile Picture
    14 on at
    Hi WillPage,
    I don't see any errors at all. Everthing looks ok.
    I have 2 users added but i only see one for example in the group.
    If there is an existing user  does it actually do a replace or it doesn't do anything
    Hope someone from MS can help its very strange
     
  • Suggested answer
    PI-28080747-0 Profile Picture
    14 on at
    All sorted.
    For some reason i changed my api to start using GroupID ad its performing better.
    It seems there is a bit of a bug when using SP group names
  • Suggested answer
    Jalpa Mahesh Dhola Profile Picture
    35 on at
    Please add the API and body in http request as I stated below. I tried this in my tenant and added two users in the SharePoint group together.
     
    _api/SP.Web.ShareObject
     
    {"url": "https://<TenantName>.sharepoint.com/sites/<SiteName>","peoplePickerInput": "[{'Key':'i:0#.f|membership|UserPrincipalName'},{'Key':'i:0#.f|membership|UserPrincipalName'}]","roleValue": "group:<groupId>"}
     
     
    Thanks
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard