List Members

Definition


The “List Members” action in Microsoft Teams allows you to retrieve all members of a specific team, channel, or chat within your organization. This action is essential for automating workflows that involve team management, user notifications, or reporting. Key capabilities include:

  • Retrieving members from a Team, Channel, or Chat.
  • Accessing detailed member information, including Member ID, Display Name, User ID, and Email.
  • Handling large groups efficiently with pagination using Max Results and Next Page Token.

This action ensures you can programmatically access member lists for any Microsoft Teams entity, making it easier to manage users and integrate with other systems.



Example Use Cases


  1. Generate Team Member Reports Automatically retrieve all members of a team to create a report of team composition, roles, or contact information.

  2. Send Notifications to Channel Members Fetch channel members dynamically to send personalized messages or alerts without manually checking the member list.

  3. Audit Team Membership List all members to verify that only authorized users have access to a specific team, channel, or chat for compliance purposes.

  4. Sync Members with Other Systems Automatically pull member lists to update external systems such as HR databases, CRM platforms, or SharePoint lists.

  5. Automate Onboarding Workflows Retrieve new team or chat members to trigger automated welcome messages, training assignments, or resource access workflows.


Inputs


  1. Connection

    This field represents the authentication required to access your Microsoft Teams environment.

    Establishing a connection allows Zenphi to retrieve member data from your organization securely.


  1. Type

    Select the type of entity whose members you want to list. The available input fields depend on your selection:

    2.1.Team – Retrieves members of a specific team.

    • Team Id: The unique identifier of the team.

      • After establishing the connection, a list of available teams is displayed for selection.
      • Alternatively, provide the Team Id directly as a static value (hardcode) or dynamically using the token picker (chain icon) from a previous action.

    2.2.Channel – Retrieves members of a specific channel within a team.

    • Team Id: The unique identifier of the team containing the channel. Works the same way as above.

    • Channel Id: The unique identifier of the channel.

      • Once connected, a list of channels will be displayed for selection.
      • Alternatively, provide the Channel Id as a static value or via token picker from a prior action.

    2.3.Chat – Retrieves members of a one-to-one or group chat.

    • Chat Id: The unique identifier of the chat.

      • After connecting, a list of available chats is displayed.
      • Can also be provided directly as a static value or dynamically using the token picker.

  1. Max Results

    • Specifies the maximum number of members to return per page (range: 1–100).
    • Helps manage pagination and prevents large data loads in a single request.

  1. Next Page Token

    • Token used to retrieve the next page of members when results exceed the Max Results limit.
    • If left empty, the action returns the first page of results.
    • If provided, the action fetches subsequent pages, enabling iteration through all members efficiently.


Outputs


  1. Members A list of members retrieved from the selected Team, Channel, or Chat. Each member includes detailed information:

    • Member Id – The unique identifier of the member within Microsoft Teams. Useful for referencing the member in subsequent actions.
    • Display Name – The full name of the member as shown in Microsoft Teams. Helps identify users easily.
    • User Id – The unique identifier of the user across Microsoft 365, which may be required for integrations with other Microsoft services.
    • Email – The email address associated with the member’s Microsoft Teams account. Useful for sending notifications or syncing with external systems.

  1. Count

    • Indicates the total number of members returned in the current page.
    • Helps track the size of the retrieved member list and manage pagination logic.

  1. Next Page Token

    • A token that can be used to fetch the next page of members if the total exceeds the Max Results limit.
    • Null if there are no more pages.
    • Enables iterative processing for large teams, channels, or chats without missing any members.



Example Situation


Scenario: You are managing a project team in Microsoft Teams and need to send a personalized notification to all team members whenever a new milestone is reached. Rather than manually checking who is part of the team, you want to automatically retrieve the member list and use it in your workflow.

Steps to Implement:

  1. Set the Trigger

    • For example, use an “On-Demand Trigger” or a trigger based on a project milestone being updated in your project management system (e.g., Jira, Asana, or SharePoint List).
  2. Configure the “List Members” Action

    • Connection: Select your established Microsoft Teams connection.
    • Type: Choose Team to retrieve members of a specific team.
    • Team Id: Select the team from the dropdown or provide it dynamically via token picker.
    • Max Results: Set to 100 to ensure you get all members in one page (or use multiple pages with the Next Page Token if needed).
  3. Use the Output

    • The action returns a list of members, including Member Id, Display Name, User Id, and Email.
    • Iterate over this list to send notifications, create personalized emails, or log member activity in another system.
  4. Optional Pagination

    • If your team has more members than the Max Results, use the Next Page Token output to fetch additional pages until all members are processed.

Outcome: The workflow now dynamically retrieves all members of the team and can perform automated actions like sending notifications, logging activity, or syncing member information without any manual effort. This ensures accuracy and saves time while keeping your processes fully automated.


Best Practices


  1. Use the Correct Type for Members

    • Always select the appropriate Type (Team, Channel, or Chat) before configuring other inputs.
    • Selecting the wrong type can result in empty or incorrect member lists.
  2. Provide Accurate Identifiers

    • Ensure Team Id, Channel Id, or Chat Id are correct.
    • You can use the token picker for dynamic selection to reduce human error when chaining from previous actions.
  3. Manage Pagination Efficiently

    • Use the Max Results and Next Page Token to handle large teams or channels.
    • Iteratively fetch pages to ensure no members are missed.
  4. Filter Members if Needed

    • For very large teams, consider filtering members in subsequent actions based on roles, emails, or other criteria.
    • Reduces processing time and resource usage in your flows.
  5. Secure Member Data

    • Treat the outputs (Member Id, Display Name, User Id, Email) as sensitive information.
    • Avoid exposing this data to unauthorized users or logs.
  6. Error Handling

    • Implement error handling to manage scenarios where a team, channel, or chat no longer exists.
    • Use conditional checks before proceeding with actions that depend on member lists.
  7. Dynamic Integration

    • Use the outputs in combination with other Zenphi actions, such as sending messages, creating tasks, or updating records, for fully automated workflows.
    • Tokenize outputs to make flows more flexible and maintainable.
  8. Test Before Scaling

    • Run the action on a small team or chat first to verify correctness before applying it to large teams or production flows.
    • Helps catch misconfigurations early and ensures smooth scaling.