0
votes

I have a sharepoint site that was automatically generated when a Team was created in MS Teams. I am an owner of the Team and therefore also of the sharepoint site. In the sharepoint site I made a list in which all Team members can add new rows. In Power Automate I made a flow that interacts with this list. In this flow I want to check if the person who runs the flow is an owner of the Teams site.

I found the following REST call to do this. Where I of course substitute <user email> with my email address and <group name> with the owner group name (a Sharepoint Group).

_api/web/sitegroups/getByName('<group name>')/Users?$filter=Email eq '<user email>'

Unfortunately the output is empty, while I really should be a member of the group because I am listed as owner in Teams!

Now, apparently there is a difference between Sharepoint Groups and Office 365 Groups (created with Teams). So my question would be: is there a non-premium way within Power Automate to check whether a user is part of an Office 365 Group? Because checking if the user is part of a Sharepoint Group does not work for me..

2
You can fetch the group members using Graph API by passing the Group IDTrinetra-MSFT

2 Answers

0
votes

I looked into your use case. First thing first what is your Trigger for Flow.

Also do you get user's details (one who ran the flow) such as ID or email.

Now with respect to Teams, There is out of box connector with power automate but unfortunaltey it will not come handy. Because it does not give info about Team owener of Team members or so on.

You will have to query API (microsoft Graph API). You Graph API, you will be easy to find Team owner and so on.

Once you have this deatils you will be easy to figure out if your email or UserId macthes or somehting.

sampel api call

GET https://graph.microsoft.com/v1.0/teams/{id}

but go through this graph api for Teams and you will figure it out

Also to talk with Graph API you will need Bearer token.

Graph API with power-automate