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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,649)