Small Tips and Tricks : Power Platform – Power Automate – simple Power Automate to get site group Id from group display name

Hi All,
Greetings for the day!!!
Today new small tip and trick. Today’s tip regarding Power Automate.
Details / Background
- We were automating the process of adding selected user to given group for our organization users
- Here we maintained one list in our SharePoint online site with following schema
- User – Person and Group – only Persons are allowed
- Group – Person and Group – only Groups are allowed
- Here respective selected User in a list will get added to given selected Group from list
- We need groupid to add user to respective group
- To get group id we need to get all groups and find our group which is added in list and get group id
- So here small tip – how to get site group Id from group display name in Power Automate
Detailed steps – Power Automate
- For demo purpose we will create – “Instant cloud flow“, so that we could trigger it manually as
- After creating “Instant cloud flow” we have an manual trigger as

- As we select “Manually trigger a flow“, we are ready to edit the flow

- Next step is too add an action – “Send an HTTP request to SharePoint“. We have very good article on calling SharePoint REST API from Power Automate – https://knowledge-junction.in/2022/07/12/power-platform-power-automate-calling-sharepoint-rest-api/
- search for text “http” and select action – “Send an HTTP request to SharePoint“
- Once we added an action – “Send an HTTP request to SharePoint“, we are read to use the REST API to get all the sitegroups
- To get group Id we need group display name
- For our SharePoint site we have following groups as
- Here for demo purpose we will use hard-coded group for now – ‘Demo Members’
- REST API to get all the site groups with filter on “LoginName” (group display name) – _api/web/sitegroups?$filter=LoginName eq ‘Demo Members’&$select=Id&top=1
_api/web/sitegroups?$filter=LoginName eq '<Group Name>'&$select=Id&top=1
- Following our respective action – “Send an HTTP request to SharePoint“

- We are ready to test the flow
- Test the flow
- As flow get executed successfully, the above action returns the group id as

- Next, we could use either “Select” or “Compose” action to get the respective group Id from an output of action – “Send an HTTP request to SharePoint“
- We have a separate article to get / know the Group Membership ID, please have a look – Microsoft 365 : SharePoint Online – Get the Group Membership ID from UI / Fetching all the users of SharePoint group using REST API
Thanks for reading !! If its worth at least reading once, kindly please like and share !!! SHARING IS CARING 🙂
Enjoy the beautiful life !! Have a FUN !! HAVE A SAFE LIFE !! TAKE CARE 🙂
You must log in to post a comment.