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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading