cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
na44
New Member

Power Automate - O365 Groups activities - Get group ID

Hello

I am very new to O365 tools, but I am looking to automate an approvals process and retrieve personal O365 email addresses from a distribution group.

I tried two solutions, none of which worked for me due to lack of knowledge.

Test 1: I wanted to use the O365 Groups activities connector so I didn't need to authenticate.

I have the distribution email address, and want to use the 'List Group members' activity

UKT0m.jpg

In order to use it I need to get the ID dynamically for the specific distribution email address.

I tried using the O365 Send Http Request which uses the graph groups, I tested the request in the Graph explorer, all worked well.

EU5OP.jpg

However when I use it in the power automate flow I get the error message below.

the URI is

 

 

 

 

 

https://graph.microsoft.com/v1.0/groups?$filter=mail eq 'my_email@xx.com'

 

 

 

 

 

the error is URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource is not one of the supported (me, users, groups, sites, search, planner, teams, chats): https://graph.microsoft.com/v1.0/groups?$filter=mail eq 'my_email@xx.com'

g1Jzx.jpg

 

Here I have also tried replacing spaces with %20 URI https://graph.microsoft.com/v1.0/groups?$filter=mail%20eq%20'my_email@xx.com', with no luck.

 

I tried putting the URI in a variable, same problem. I tried adding ConsistencyLevel: eventual and $count=true in case the issue was to do with filter being an advance query capability, same error as above.

 

The only thing that worked was if I use the URI without the OData query, e.g. https://graph.microsoft.com/v1.0/groups

That means that I can fetch all the groups but not a specific one. The problem that I faced here is that this only returns the first 100 results, not the whole list of groups, therefore I am unable to work with filtering the JSON file later on in the flow, and of course I cannot use the $top query option as I'm faced with the above error.

URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource is not one of the supported (me, users, groups, sites, search, planner, teams, chats): https://graph.microsoft.com/v1.0/groups?$top=200

 

Test 2

I used a generic HTTP request for the URI with the filter https://graph.microsoft.com/v1.0/groups?$filter=mail eq 'my_email@xx.com' and it worked. However I didn't know how to authenticate, so copied the temporary Bearer token from Graph explorer for testing purposes, but obviously it expired so I cannot use this solution.

I tried using Basic authentication using the O365 email and password, but the HTTP request failed with error CompactToken parsing failed with error code: 80049217.

 

My question is please could you help me with why the Test 1 might not be working in power automate when working fine in Graph explorer, or why the basic authentication isn't working for Test2?

Thank you!

J

1 ACCEPTED SOLUTION

Accepted Solutions
VictorIvanidze
Resident Rockstar
Resident Rockstar

Hi @na44,

 

I think you have already noticed the action "Send an HTTP request (Preview)" is quite buggy.

 

Just add a slash between /groups and ?: 

 

https://graph.microsoft.com/v1.0/groups/?$filter=mail eq 'my_email@xx.com'

 

 



Freelance Power Automate developer. $50 per hour.

View solution in original post

4 REPLIES 4
VictorIvanidze
Resident Rockstar
Resident Rockstar

Hi @na44,

 

I think you have already noticed the action "Send an HTTP request (Preview)" is quite buggy.

 

Just add a slash between /groups and ?: 

 

https://graph.microsoft.com/v1.0/groups/?$filter=mail eq 'my_email@xx.com'

 

 



Freelance Power Automate developer. $50 per hour.

View solution in original post

na44
New Member

Thank you SO much @VictorIvanidze , I am so grateful, it all works now!!!

Glad to help.

(I've spent 6 hours to localize this f... bug)



Freelance Power Automate developer. $50 per hour.

I found this buggy too,it works for me ,thanks!!

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,967)