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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a SP Group Us...
Power Automate
Answered

Creating a SP Group Using Power Automate and REST API

(0) ShareShare
ReportReport
Posted on by 1,362

Hello,
I found a resource that explains how to create a SharePoint group using Send an HTTP Request and Parse JSON.
However, when I use this, a new SP Group(s) is not created.
Any help would be appreciated.

golfnutt82_1-1630419151103.png

 

Categories:
I have the same question (1)
  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @golfnutt82,

     

    Can you switch the method from GET to POST? 

  • golfnutt82 Profile Picture
    1,362 on at

    I tried Post and it hung forever.

  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @golfnutt82,

     

    Did you try it with the same title and description in the body of the request from your first screenshot?

     

    If so, can you try a different title (e.g. FlowGroup2)? It looks like the SharePoint group with title FlowGroup already exists (looking at the get GET response from your first screenshot).

  • golfnutt82 Profile Picture
    1,362 on at

    I tried changing it to "FlowGroup1" ran it but I still dont see a created group.

    golfnutt82_0-1630431814142.png

     

  • golfnutt82 Profile Picture
    1,362 on at

    I think I know what the issue but I am not sure so maybe you can clear things up for me.
    Where the URI is I entered per the instruction 

    golfnutt82_1-1630497641614.png

    Because I am working from withing a sub-site having unique permissions from the parent should the URL look different? I am concerned that I created the group(s) at the top level.

    golfnutt82_2-1630497819385.png

     

  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @golfnutt82,

     

    You are looking at the assigned permissions. We haven't assigned any permission level (e.g. read, edit or full control) to this group yet. That is why it isn't shown in the site permissions overview.

     

    If you want to see the group itself you could navigate to the People and Groups overview of the sub-site. That should be accessible via this url:

    /sites/Test-IT/SecTest/SecTest1/_layouts/15/groups.aspx

  • golfnutt82 Profile Picture
    1,362 on at

    Ahh, I see. Yes the group was created but now I want to assign the group permissions and then add users.
    I appreciate your help.

  • golfnutt82 Profile Picture
    1,362 on at

    I just thought of something; what if the group is already created? Can I check this condition and then just add the user to the existing group?

  • Verified answer
    Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @golfnutt82,

     

    1. To check if the SharePoint group already exists you can use a filter with the Title with a GET request. If the response is empty your group doesn't exist yet.

     

     

    _api/Web/SiteGroups/?$filter=Title eq '@{variables('SharePointGroupName')}'

     

     

    getsitegroups.png

     

    2. To add a user you can use a POST request against the specific site group.

    Make sure you use the correct claim of the user.

     

     

    _api/web/sitegroups/GetByName('@{variables('SharePointGroupName')}')/Users

     

     

     

    { 
     '__metadata': { 
     'type': 'SP.User' 
     }, 
     'LoginName': '@{variables('UserClaim')}' 
    }

     

     

    addusertogroup.png

     

    3. When the site already has unique permissions you can use the addroleassignment method with a POST request to assign permissions to your new or existing group.

    In the example below I am using contribute permission. Also make sure you use the correct principalid of the SharePoint group.

     

     

    _api/web/roleAssignments/addroleassignment(principalId=@{variables('Id')}, roledefId=1073741827)

     

     

    grantcontributepermissiontogroup.png

  • golfnutt82 Profile Picture
    1,362 on at

    Thank you very much for these details!
    Extremely grateful for your assistance.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard