cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
admiralman
Helper I
Helper I

Microsoft Graph HTTP Unsupported Query

I am trying to get a list of all distribution lists using MS Graph API and an HTTP request from a flow. I have the following query which works correctly

 

$filter=mailEnabled eq true and securityEnabled eq false&$count=true&$top=999

 

However, when I try to filter out Microsoft 365 groups I get an Unsupported Query error. This occurs when I use the following filter query

 

$filter=not groupTypes/any(c:c eq 'Unified') and mailEnabled eq true and securityEnabled eq false&$count=true&$top=999

 

If I remove the NOT the query executes correctly. Is the NOT operator unsupported?

 

If so, is there any recommendation for how to bring all results within the Flow and parse out those that have Unified as the groupType?

1 ACCEPTED SOLUTION

Accepted Solutions
VictorIvanidze
Community Champion
Community Champion

Hi @admiralman,

 

add  the header ConsistencyLevel and set its value to eventual.

 

After that the query

https://graph.microsoft.com/v1.0/groups?$count=true&$filter=not groupTypes/any(g:g+eq+'unified') 

works fine for me.

 

See https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-beta#properties

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

View solution in original post

6 REPLIES 6
VictorIvanidze
Community Champion
Community Champion

Hi @admiralman,

 

add  the header ConsistencyLevel and set its value to eventual.

 

After that the query

https://graph.microsoft.com/v1.0/groups?$count=true&$filter=not groupTypes/any(g:g+eq+'unified') 

works fine for me.

 

See https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-beta#properties

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

In the HTTP Request in Flow...I had to change ConsistencyLevel to consistencylevel and it started working.

Great! I guess you forget to do something...

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
admiralman
Helper I
Helper I

Not really...I didn't realize that the HTTP request option is case sensitive for that header.

VictorIvanidze
Community Champion
Community Champion

No I mean another thing - did I answer your question?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
admiralman
Helper I
Helper I

I figured it out myself yesterday but your answer was correct. Accepted your's as solution.

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,161)