List Teams

🔹 Definition

The List Teams action retrieves a list of all Microsoft Teams in your organization. It allows you to view teams in a paginated format, control how many results are returned per page, and use a token to fetch additional pages if needed. This action is especially useful for discovering active teams, reviewing team details (such as name, description, and visibility), or feeding team data into other automated processes.

Key capabilities include:

  • Returning a comprehensive list of teams within the tenant.
  • Providing team metadata such as ID, name, description, and visibility.
  • Supporting pagination through maximum results and next page token, making it scalable for organizations with many teams.


🔹 Example Use Cases

  1. Audit All Active Teams Quickly generate a list of all teams in your organization to review naming conventions, descriptions, and visibility settings for compliance or governance purposes.

  1. Populate Dropdowns in Workflows Use the retrieved team list to provide dynamic dropdown options in a Zenphi Form, making it easier for users to select an existing team.

  1. Identify Inactive or Redundant Teams Combine this action with reporting tools to check for teams without recent activity and decide whether to archive or delete them.

  1. Department-Wise Reporting Retrieve teams and their details to build departmental or project-based reports, ensuring management has visibility of collaboration spaces.

  1. Pagination for Large Organizations Use the Next Page Token to handle environments with hundreds or thousands of teams, ensuring no team is missed when processing large datasets.


🔹 Inputs

  1. Connection Defines the Microsoft Teams connection that will be used to perform the action. You must sign in with the appropriate organizational account that has permission to access and list teams in your tenant. Without a valid connection, the action cannot retrieve any data.

  1. Max Results Sets the maximum number of teams to return per page. The value can range between 1 and 999.

    • If your organization has only a few teams, you may want to set this to a smaller number for faster responses.
    • For large organizations with hundreds of teams, setting it closer to 999 ensures you capture more results in a single request, reducing the number of calls needed.

  1. Next Page Token A token that enables pagination when dealing with large numbers of teams.

    • If the number of teams exceeds the Max Results value, the system provides a token to fetch the next page of teams.
    • You can pass this token into the action again to continue retrieving additional pages until no token is returned, which means you’ve reached the end of the list.
    • This ensures that you can reliably handle even very large tenant environments without missing any teams.


🔹 Outputs

  1. Teams A collection of all the teams retrieved in the current request. Each team includes important details that help you understand its identity and settings:

    • Team ID – The unique identifier assigned to the team by Microsoft Teams. This ID is essential if you want to perform follow-up actions such as updating, archiving, or listing channels within that team.
    • Team Name – The display name of the team as it appears in Microsoft Teams (e.g., Marketing Team, Project Alpha).
    • Team Description – A short description of the team, usually entered by the creator or owner. This can provide context about the purpose or scope of the team (e.g., “Team for global marketing initiatives”).
    • Team Visibility – Indicates whether the team is Public (anyone in the organization can find and join) or Private (members must be invited). This helps you quickly assess access levels across your teams.

  1. Count The total number of teams returned in the current page of results. This number depends on the Max Results you set in the input. For example, if you set Max Results = 50, and the count is 50, it means there might be more teams available and you’ll need to use the Next Page Token to continue.

  1. Next Page Token A reference token that lets you fetch the next batch of teams if your organization has more than the maximum number returned in one request.

    • If this field contains a token value, you can pass it back into the action’s input to continue retrieving additional teams.
    • If this field is null (empty), it means you’ve reached the last page and no more teams are available.


🔹 Example Situation

Imagine you are the IT administrator of a company with over 300 teams in Microsoft Teams. Your leadership team has asked you to generate a report of all active teams along with their descriptions and visibility settings so they can review how collaboration spaces are being used across the company.

Here’s how you can set it up in a flow:

  1. Trigger You start the flow with an On-demand trigger. This allows you to manually run the flow whenever you need an updated list of teams.

  2. Action – List Teams You add the List Teams action to retrieve all teams in your organization.

    • In the Max Results field, you set it to 100, so the flow pulls 100 teams per page.
    • If the company has more than 100 teams, the action will return a Next Page Token, which you can pass into another looped call to fetch the next batch.
  3. Process Results The flow captures the Teams output (Team ID, Team Name, Description, and Visibility). You then use a Create CSV or Send Email action to share the full list with stakeholders, or even push the data into a SharePoint List for long-term storage and tracking.

  4. Outcome The leadership team receives a structured report of all teams, with clear visibility into which ones are public or private, helping them decide if certain teams should be reorganized, archived, or consolidated.


👉 In short: this action is perfect when you want to get an overview of all Teams in your org for reporting, auditing, or governance — and it scales easily even in very large organizations by using pagination with the Next Page Token.



🔹 Best Practices

  1. Use Pagination for Large Organizations If your company has many teams, set a reasonable value in Max Results (e.g., 100 or 200) and use the Next Page Token to fetch the next batch. This ensures the flow runs smoothly without timeouts or memory overload.

  1. Limit Data to What You Actually Need Instead of always retrieving the maximum number of teams, only pull as many as required. For example, if you only need the top 20 teams for reporting, set Max Results = 20. This makes your flows faster and more efficient.

  1. Combine with Filters or Conditions After retrieving teams, apply filters using "Query collection" action to work only with the relevant subset. For instance, you might filter by Visibility (only “Public” teams) or by Description (e.g., teams containing “Project”). This keeps your automation focused and avoids unnecessary processing.

  1. Store Results for Future Use Instead of sending the raw output directly in an email, consider saving the Teams data into a SharePoint List, Excel file, or database. This gives you a historical record that you can track and compare over time.

  1. Automate Governance Reports Use this action regularly (e.g., with a scheduled trigger) to build governance or compliance dashboards. For example, run the flow weekly to identify newly created teams, orphaned teams (no owners), or teams with unclear descriptions.