List Chats
Definition
The “List Chats” action in Microsoft Teams allows you to retrieve a comprehensive list of all chats within your organization using Zenphi. It enables you to access one-on-one, group, or meeting chats along with their associated details such as members, creation date, last updated timestamp, and chat topic. Key capabilities include applying filters with conditional logic to narrow results, handling pagination with maximum results and page tokens, and providing structured outputs that can be used in subsequent workflow steps. This action is essential for automating chat monitoring, reporting, and collaboration management in Teams.
Example Use Case
-
Monitor Active Chats Retrieve all recently updated chats to track ongoing conversations and ensure team communication is on track.
-
Audit User Participation List all chats a specific user is part of to maintain compliance, auditing, or reporting requirements.
-
Analyze Group Chat Activity Extract information about group chats, including topics and members, to measure collaboration and engagement levels.
-
Integrate Chat Data with Reports Automatically feed chat details (members, topics, timestamps) into dashboards or project management tools for analytics.
-
Identify Orphaned or Inactive Chats Filter chats based on last updated date to locate unused chats that can be archived or cleaned up.
🔹 Inputs
- Connection Select or establish the connection to your Microsoft Teams account. This ensures the action has access to your organization’s chats and associated metadata. Only authorized connections can retrieve chat information.
- Max Results Define the maximum number of chats to return per page. The allowed range is 1–50. Setting this helps control the volume of data returned per request and can improve performance for flows dealing with large chat volumes.
- Next Page Token
A token used to retrieve the next page of results if the total chats exceed the
Max Results
limit. Use this when paginating through multiple pages of chats in large organizations.
-
Condition Allows you to filter chats based on specific criteria to narrow down the results. This is optional but highly recommended for efficiency.
Details:
You can set multiple filters and combine them using
and
/or
logic.Each filter consists of three parts:
-
Parameter: Choose the chat property to filter on. Options include:
chat type
– Filters by chat category (OneOnOne, Group, Meeting).topic
– Filters based on the chat topic.created date/time
– Filters by the date the chat was created.last updated date/time
– Filters by the most recent update timestamp.
-
Expression: Determines the type of comparison. Options include:
contains
,equal to
,not equal to
,start with
,ends with
. -
Value: The target value for filtering. You can enter a static value (hardcoded) or dynamically retrieve it using the token picker from previous actions.
Example: Filter chats where
chat type
equalsGroup
ANDlast updated date/time
is after2025-01-01T00:00:00Z
. -
🔹 Outputs
-
Chats A list of all chats returned by the action. Each chat contains the following subfields:
-
Chat id The unique identifier of the chat. This ID can be used in subsequent actions, such as sending messages or updating chat members.
-
Created date/time The date and time when the chat was created. This helps track the age of the conversation or filter chats by creation date.
-
Last updated date/time The date and time when the chat was last updated, i.e., when the last message was sent or metadata changed. Useful for identifying active or stale chats.
-
Chat type Indicates the type of chat. Possible values include
OneOnOne
,Group
, andMeeting
. Helps in distinguishing personal conversations from group or team discussions. -
Topic The subject or title of the chat. Only populated for group chats; OneOnOne chats do not have a topic.
-
Web URL A direct link to the chat in Microsoft Teams. Users can click this URL to quickly navigate to the chat in the Teams app or web interface.
-
Members A list of all participants in the chat, each with the following details:
- Member id: The unique identifier for the member within the chat context.
- Display name: The member’s full name as displayed in Teams.
- User id: The global identifier of the user in Microsoft 365.
- Email: The member’s email address associated with their Teams account.
-
- Count The total number of chats returned in the current page. This helps you understand how many chats were retrieved without inspecting the full list.
- Next Page Token
A token used to retrieve the next set of results if the number of chats exceeds the
Max Results
limit.Null
if there are no more pages. This is essential for paginating through large sets of chats.
🔹 Example Situation
Scenario:
Your company uses Microsoft Teams extensively for internal communication. The HR department wants to generate a report of all active group chats related to ongoing projects, along with the members involved in each chat. They want to automate this process using Zenphi, so they can regularly audit chats and ensure no important discussions are missed.
Steps in the Flow:
-
Trigger: The flow could start manually or on a scheduled basis, e.g., “Every Friday at 5 PM” to gather the weekly list of chats.
-
List Chats Action Setup:
-
Connection: Connect Zenphi to your Microsoft Teams account.
-
Max Results: Set to 50 to fetch up to 50 chats per page.
-
Next Page Token: Leave blank initially; use this for paginating if there are more than 50 chats.
-
Condition (Filter):
- Filter Chat type equal to
Group
(to include only project group chats). - Optionally, filter Topic contains
Project
to narrow down chats relevant to active projects. - You can combine filters using AND logic to get more precise results.
- Filter Chat type equal to
-
-
Outputs Usage:
- Iterate through the Chats list.
- Extract Chat id, Topic, and Members for reporting.
- Use Web URL to allow managers to directly access important chats.
-
Next Steps in Flow:
- Optionally, export the chat list and member details to a SharePoint list or Excel file for reporting.
- If there are more than 50 chats, use Next Page Token in a loop to fetch all chats.
Result: At the end of the flow, HR has a comprehensive list of all group chats related to ongoing projects, including their members and links to each chat, without manually checking Teams.
🔹 Best Practices
-
Use Filtering Strategically
- Apply Conditions to filter chats by type, topic, or creation date to avoid retrieving unnecessary data.
- Combine multiple filters using AND/OR logic to precisely target relevant chats.
-
Manage Pagination Efficiently
- Set Max Results according to expected volume (1–50).
- Always check Next Page Token for flows that may return more than the maximum results per page to ensure you capture all chats.
-
Handle Large Data Sets Carefully
- When dealing with many chats and members, consider looping with pagination to process results in manageable batches.
- Avoid retrieving excessive data at once to prevent timeouts or performance issues.
-
Leverage Dynamic Data
- Use the token picker to dynamically select values from previous actions for chat types, topics, or members.
- This ensures the flow adapts to different teams or projects without manual updates.
-
Use Outputs Effectively
- Extract key fields like Chat ID, Topic, Members, and Web URL for reporting, notifications, or further processing in your flow.
- Avoid storing unnecessary data that may clutter your automation or cause performance issues.
Updated 2 days ago