Remove User from SharePoint Group by LoginName

How to remove a user (by LoginName) from a single SharePoint Group in a SharePoint Online site collection using a Power Automate flow.

URI

Headers

Body

Not applicable

Screenshot with example

Sample data
SharePoint Group Name – Custom SharePoint Group
LoginName – i:0#.f|membership|jane@contoso.onmicrosoft.com (which is encoded by the encodeURIComponent function

removeauserfromgroupbyloginname

Expected response

Copy/paste example

Resources

encodeURIComponent function
SP.GroupCollection.getByName Method
SP.UserCollection.removeByLoginName Method

That’s it, Happy testing!

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.