Search code examples
c#microsoft-graph-apimicrosoft-teamsmicrosoft-graph-teams

Graph API list joined Teams where isArchived =false


I am following information from C# teams and while this works fine I would like to only download data whereby the property 'isArchived' = false. Is it possible to add a filter to do this?

I could loop through the collection after I have downloaded the data and eliminate based on this value but it seems like an extra step to perform and there are a lot of teams to loop through.

var joinedTeams = await graphClient.Me.JoinedTeams
.Request()
.GetAsync();

Solution

  • Use the Filter(...) method on the request object:

    var joinedTeams = await graphClient.Me.JoinedTeams
        .Request()
        .Filter("isArchived eq false")
        .GetAsync();