Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Checking if a SharePoint User Group has already been created.

I am able to add a new SP Group but what I need is to check to see if a group is already created before I create a new group.
The HTTP Request and JSON will error if a Group is already created.
Can I create a condition that checks if the group is already created?



Super User
Super User

Hi @golfnutt82,


You can check if the results property is empty in the response. You can use this expression for that:





In the Yes branch you can add the creation of your new group. If it is false it means it has found your group.

Hello and thank you once again for your assistance.
I input the expression and renamed it to reference the name of my HTTP request action.
I received the below error.




I am sure I must be missing something

Super User
Super User

Hi @golfnutt82,


There might be a small typo in the expression. 


It is worth checking with a compose action right after the Send an HTTP request to Get SharePoint Groups 2 action.


When you use the expression editor and add the body field you can check if the name of the action is correct.





Super User
Super User

Hi @golfnutt82,

Can you please remove the Accept application/json header entry from that request as well? I think your response will be different when you use that header. That is probably the reason why it is not receiving the 'd' property in your response.





The compose action seems to work fine.
Here is the output.



I created a new User Group and received no issues after that change.
Going to try again using the same User Group to see if that works as expected.
I need to understand this api a lot more.
Very useful information.
Thank you very much for your assistance with this.
I will keep you posted if any issues running the duplicate group.



Hello, I know the group is created at the top level but my list doesnt have any groups.
I need to add the Owners, Members and Visitors groups and then assign the users that are captured in my list item the appropriate permission.
Can I use the HTTP request to do this?

I was able to create a group and add users to the group.
The issue now is granting permissions to the new group I created and assign unique permissions.
When I attempt to grant permissions I get an error.




Can you tell me what I am missing?
Thanks again.

Super User
Super User

Hi @golfnutt82,


I think there is a small typo in your Uri. It should be principalid and roledefid:


Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,175)