MS Teams – Chats – Get Chat From Chat Items
MS Teams – Chats – Get Chat From Chat Items
Get a Teams chat from a collection of chats by id.
Action details
| Property | Value |
|---|---|
| Action label | MS Teams – Chats – Get Chat From Chat Items |
| Category | CloudTools |
| Apex class and method | GetMSTeamsChatById.getChatById |
| Input type | GetMSTeamsChatById.GetMSTeamsChatByIdInput |
| Output type | List<MSTeamsChat> |
| Authorization | No connection required. |
Prerequisites and permissions
Supply a previously retrieved collection of the documented model type. This helper performs no callout and needs no Microsoft connector or permissions of its own.
Inputs
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Id | id | String | Yes | Chat id to find |
| Items | items | List<MSTeamsChat> | Yes | Chats to search |
Outputs
Returns one item per request, preserving request order. A null request, blank ID, null collection, or missing match yields null. An empty or null request list returns a single null element. The first matching non-null item is returned.
| Output | Apex field | Type | Description |
|---|---|---|---|
| Id | id | String | Unique identifier of the chat |
| Topic | topic | String | Topic of the chat (group or meeting chats) |
| Created Date Time | createdDateTime | String | Created timestamp for the chat |
| Last Updated Date Time | lastUpdatedDateTime | String | Last updated timestamp for the chat |
| Chat Type | chatType | String | Type of chat (oneOnOne, group, meeting) |
| Web URL | webUrl | String | Link to the chat in Teams |
| Is Hidden For All Members | isHiddenForAllMembers | Boolean | Whether the chat is hidden for all members |
| Viewpoint | chatViewpoint | MSTeamsChatViewpoint | Chat viewpoint data for the signed-in user |
| Members | members | List<MSTeamsConversationMember> | Members in the chat (available with $expand=members) |
| Last Message Preview | lastMessagePreview | MSTeamsMessagePreview | Preview details of the latest message |
| OData Type | odataType | String | OData type for the chat |
| OData ETag | odataEtag | String | OData ETag for the chat |
| Additional Properties | additionalProperties | List<DynamicObject> | Additional properties from user-defined query |
Use in Flow
Add MS Teams – Chats – Get Chat From Chat Items where supported. Pass a previously retrieved collection and an ID; check the returned item for null.
Use in custom Apex
This subscriber-org example uses the Apptigent namespace. Replace example identifiers and values before use. No callout context is required.
Apptigent.GetMSTeamsChatById.GetMSTeamsChatByIdInput request =
new Apptigent.GetMSTeamsChatById.GetMSTeamsChatByIdInput();
request.id = 'REPLACE_WITH_ID';
request.items = new List<Apptigent.MSTeamsChat>{ /* previously retrieved items */ };
List<Apptigent.MSTeamsChat> results =
Apptigent.GetMSTeamsChatById.getChatById(
new List<Apptigent.GetMSTeamsChatById.GetMSTeamsChatByIdInput>{ request }
);
System.debug(results);
Use in a Lightning Web Component
This helper is not exported by msTeamsConnectorLib. Search an existing JavaScript collection with items.find(item => item && item.id === id) || null; this performs no callout.
Error handling and troubleshooting
| Symptom | What to check |
|---|---|
| Null match | Check the collection type and ID. A missing match is returned as null. |