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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / GraphAPI HTTP Request ...
Power Automate
Unanswered

GraphAPI HTTP Request on name instead of ID

(0) ShareShare
ReportReport
Posted on by 122

Hi All,

 

Hoping someone could point me in the right direction because I can't seem to figure out what I'm doing wrong.

I'm trying to use the graphAPI to get the ID of a group (distribution list) using the display name, but I keep getting a 'invalid filter clause' error which makes me to believe my graphAPI call is incorrect; I haven't successfully found any documentation on using names instead of IDs except for this previous Flow post but I can't seem to get what they're doing to work in my scenario.

These are a few of the GraphAPI calls I've been using but none appear to be correct formula for flow to play nice:

 

 

 

https://graph.microsoft.com/v1.0/groups/?$search="displayName:#QLD-XXX-IT - All IT"
https://graph.microsoft.com/v1.0/groups/?$filter=startswith(displayName,'#QLD-XXX-IT - All IT')
https://graph.microsoft.com/v1.0/groups/?$filter=startswith(displayName,'#QLD-XXX-IT - All IT')
https://graph.microsoft.com/v1.0/groups/?$filter=displayname+eq+'#QLD-XXX-IT - All IT'

 

 

 

 I went into the Office365 admin portal and manually got the groupID and can successfully get the data I need when the ID is statically set. However, I need this flow to be dynamic due to the use case (getting Distribution List email from DL name entered in SharePoint). This is the API Call that does work, when the groupID is static:

 

 

 

https://graph.microsoft.com/v1.0/groups/b8fb9015-f7f7-423e-8477-[REDACTED]

 

 

 

Both the above code blocks are being executed using the Office365 Groups function in Power Automate calling a HTTP Request (Preview).

Any help would be appreciated 🙂

Cheers

Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @MGeale

    open the Graph explorer and play a bit to get a valid request. After that try to execute the same request using a flow action.

  • Verified answer
    mgrachii Profile Picture
    206 on at

    hi, can you try removing the "/" at the very end? 

    should look like this

    https://graph.microsoft.com/v1.0/groups?$filter=startswith(displayName,%27#QLD-XXX-IT%20-%20All%20IT')

     

  • MGeale Profile Picture
    122 on at

    Hi @mgrachii,

    Thanks for your assistance - I managed to get it in the end using the the exact same logic - with a few minor tweaks :). I chucked the above into the GraphAPI explorer and all works a treat and returns code 200. I wasn't aware you needed to replace the white space or special characters in these types of instances. I'll mark what you put above as the solution as it solves my needs 🙂

    For those who run into the same issue I do:

    Use an encodeURIComponent, compose function, to change your DL group's name into a URI friendly format. I'm unsure if its just the GraphAPI or APIs in general but they don't like special characters ie # , _ - etc. I don't know if that 'knowledge' comes from experience, but I couldn't find a single mention of 'URI structure' in the GraphAPI documentation or anywhere when searching for an answer. I know I'm a noob so I'm sure that understanding just comes from experience of which I don't have a lot of. 

    Thanks again guys for your help 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard