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

fig : Power Platform – Power Automate – action “Send an HTTP request to SharePoint” to get the group id from group display name
fig : Power Platform – Power Automate – action “Send an HTTP request to SharePoint” to get the 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 stepsPower Automate

  • For demo purpose we will create – “Instant cloud flow“, so that we could trigger it manually as
fig : Power Platform – Power Automate – creating “Instant cloud flow”
fig : Power Platform – Power Automate – creating “Instant cloud flow”
  • After creating “Instant cloud flow” we have an manual trigger as
fig : Power Platform – Power Automate – creating “Instant cloud flow” – adding trigger – “Manually trigger a flow”
fig : Power Platform – Power Automate – creating “Instant cloud flow” – adding trigger – “Manually trigger a flow”
  • As we select “Manually trigger a flow“, we are ready to edit the flow
fig : Power Platform – Power Automate – creating “Instant cloud flow” – added trigger – “Manually trigger a flow”
fig : Power Platform – Power Automate – creating “Instant cloud flow” – added trigger – “Manually trigger a flow”
fig : Power Platform – Power Automate – adding an action “Send an HTTP request to SharePoint”
fig : Power Platform – Power Automate – adding an 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
fig : SharePoint online - Site groups - groups display names
fig : SharePoint online – Site groups – groups display names
  • 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
fig : Power Platform – Power Automate – action “Send an HTTP request to SharePoint” to get the group id from group display name
fig : Power Platform – Power Automate – action “Send an HTTP request to SharePoint” to get the group id from group display name
  • We are ready to test the flow
  • Test the flow
  • As flow get executed successfully, the above action returns the group id as
fig : Power Platform – Power Automate – flow executed successfully - action “Send an HTTP request to SharePoint” returns group id "6" for given group display name
fig : Power Platform – Power Automate – flow executed successfully – action “Send an HTTP request to SharePoint” returns group id “6” for given group display name

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 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

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

%d bloggers like this: