5 min read

readChats Documentation

Overview

This node facilitate the retrieval of Microsoft Teams chat data that a user is part of. When invoked, it returns a structured output containing a list of chat objects, each representing a chat that the user can access within their Microsoft Teams environment. This component plays a crucial role in analytics and data reporting, allowing users to analyze their chat interactions and derive insights from them.

Purpose

The primary purpose of the readChats component is to interact with the Microsoft Teams Chat API to list the chats associated with a particular user. It simplifies the process of accessing chat data, thereby enabling advanced analytics and reporting features in the Vantage analytics platform.

Settings

The readChats component has a single configurable setting:

Setting: maxResults

  1. Setting Name: maxResults
  2. Input Type: Numeric (integer)
  3. Description: This setting defines the maximum number of chat records to retrieve from Microsoft Teams. The value must be constrained to the range of 1 to 50. The component defaults this setting to 25 if not provided, which means that if the user doesn't specify this parameter, it will only return up to 25 chat records by default. By changing this setting, users can control how many chat records they wish to fetch, which can affect response time and the amount of data processed in subsequent operations or visualizations.
  4. Default Value: 25

How It Works

The readChats component operates asynchronously to ensure non-blocking interactions with the Teams API. Here's a step-by-step breakdown of its operation:

  1. Integration Initialization: The function begins by establishing a connection to the Microsoft Teams chat integration via integration connection. This process utilizes the provided context to authenticate and configure the connection settings.

  2. Input Handling: It retrieves the maxResults parameter from the inputs or the configuration object. A validation process is performed to ensure the value is an integer within the acceptable range (1 to 50). If the maxResults parameter exceeds these constraints, the function adjusts it accordingly.

  3. Chat Retrieval: Once the maxResults parameter is validated, the function calls the listChats method of the Teams chat integration. This method sends a request to the Microsoft Teams API to retrieve the specified number of chats.

  4. Data Mapping: The result obtained from the API call is processed. Each chat object returned is transformed into a more manageable format using the TeamsChatIntegration.chatToRow mapping logic.

  5. Output Preparation: Finally, the component returns an object encapsulating the structured list of chats and metadata, including the total number of results.

  6. Error Handling: If an error occurs during any of these steps, it is caught, logged to the console, and an error message is returned.

Expected Data

The node expects the following data types:

The structure of the output data includes:

AI Integrations

Currently, there are no direct AI integrations within the readChats component itself. However, the retrieved chat data can serve as input for subsequent analytics processes, which may leverage AI capabilities for sentiment analysis, trend identification, or other forms of data intelligence in later stages of the data pipeline.

Billing Impact

The readChats component's usage may have implications on billing depending on the following factors:

Use Cases & Examples

Use Case 1: Monitoring Team Collaboration

A project manager may wish to monitor team interaction within Microsoft Teams to gauge the level of engagement among team members. Using the readChats component, they can retrieve a list of chats relevant to their projects, helping identify active discussions and contributions from team members.

Use Case 2: Evaluating Customer Support Interactions

A customer support team can use this node to analyze conversations held with customers. By extracting data from relevant chats, the team can identify trends in customer inquiries and evaluate support response strategies.

Example Configuration

Use Case Detail: An analytics team needs to evaluate chat activity during a product development cycle. They want to ensure they review a maximum of 30 recent chats.

Sample Configuration:

json
{
    "inputs": {
        "maxResults": 30
    },
    "config": {
        "maxResults": 25 // This can be overridden by inputs
    },
    "context": {
        "userId": "12345-abcde-67890",
        "authorization": "Bearer token_string_here"
    }
}

In this configuration, the team will retrieve up to 30 chat records, ensuring they can adequately assess team communications during the relevant phase of product development. This targeted retrieval allows for focused analysis without overwhelming datasets.