MS Teams – Chats – Get Chat From Chat Items

Estimated reading: 2 minutes

MS Teams – Chats – Get Chat From Chat Items

Get a Teams chat from a collection of chats by id.

Action details

PropertyValue
Action labelMS Teams – Chats – Get Chat From Chat Items
CategoryCloudTools
Apex class and methodGetMSTeamsChatById.getChatById
Input typeGetMSTeamsChatById.GetMSTeamsChatByIdInput
Output typeList<MSTeamsChat>
AuthorizationNo 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

InputApex fieldTypeRequiredDescription
IdidStringYesChat id to find
ItemsitemsList<MSTeamsChat>YesChats 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.

OutputApex fieldTypeDescription
IdidStringUnique identifier of the chat
TopictopicStringTopic of the chat (group or meeting chats)
Created Date TimecreatedDateTimeStringCreated timestamp for the chat
Last Updated Date TimelastUpdatedDateTimeStringLast updated timestamp for the chat
Chat TypechatTypeStringType of chat (oneOnOne, group, meeting)
Web URLwebUrlStringLink to the chat in Teams
Is Hidden For All MembersisHiddenForAllMembersBooleanWhether the chat is hidden for all members
ViewpointchatViewpointMSTeamsChatViewpointChat viewpoint data for the signed-in user
MembersmembersList<MSTeamsConversationMember>Members in the chat (available with $expand=members)
Last Message PreviewlastMessagePreviewMSTeamsMessagePreviewPreview details of the latest message
OData TypeodataTypeStringOData type for the chat
OData ETagodataEtagStringOData ETag for the chat
Additional PropertiesadditionalPropertiesList<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

SymptomWhat to check
Null matchCheck the collection type and ID. A missing match is returned as null.

See Teams connector introduction.

Share this Doc

MS Teams – Chats – Get Chat From Chat Items

Or copy link

CONTENTS

Free eBook: The Ultimate Guide to Power Platform Custom Connectors

Antimanual

Ask our AI support assistant your questions about our platform, features, and services.

You are offline
Chatbot avatar
What can I help you with?

Subscribe

×
Cancel