June 23, 2024

SamTech 365

PowerPlatform, Power Apps, Power Automate, PVA, SharePoint, C#, .Net, SQL, Azure News, Tips ….etc

List all the MS Teams you have joined in PowerApps

In my previous article, I have covered how you can get started with the Graph Api integration with Power Apps.

If you have missed this article, you can jump back and get started.

Get Started with GraphAPI in Power Apps

In Today’s article, we will look at how you can list all the MS Teams Teams you have joined.

We are aiming at creating a simple app, which lists all the teams, and allow the users to jump quickly to one of their teams.

Call to GraphAPI to get all the teams

First, we will need to have a button which performs a call to the GraphAPI and returns the list of all the teams joined by a logged in user.

If we revert quickly back to the Graph Explorer, we can see that there is a function which lists all the teams, the function in question is called joinedTeams.

So, our button will make the call to this end point as follow:

Set(varAllTeams, Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/me/joinedTeams","GET",""))

Basically, we are creating a collection which will contains the JSON result from this call.

Next, we will need to use this collection (converted to a table) to populate a gallery: