Ever felt lost trying to preserve those critical Microsoft Teams chats? Say goodbye to the hassle of copy-pasting or screenshotting conversations. In this blog post, we will learn how to extract and export MS Teams Chat/Channel conversations using Power Automate.
MS Teams has no out-of-the-box (OOB) feature to save chats systematically. There are specific workarounds like copy-paste or taking screenshots of the chat. However, they do not provide easy and convenient ways of reading the outputs.
Why do we need to save the Chat/Conversations?
There may be use cases like the Legal team wanting to have the capability to save team chats/conversations as records to produce them as evidence.
Another user case may be that the chats will get deleted in x number of days due to the retention policy. Hence, a periodic chat history backup must be maintained for x number of years. Saving important business conversations for future reference also could be an important use case.
Business Benefits
- Avoid auto deletion of chats due to retention policies and retain message backup for future reference. Using Microsoft Power Automate, you can set up flows to export teams’ chat periodically, ensuring that you have a consistent backup of all your important conversations.
- Store chat/conversations as evidence records, which the Legal Team might require. With Microsoft Teams Chat export, you can systematically archive conversations in a format that is easy to access and read. This feature is invaluable for legal compliance and can serve as evidence in legal disputes.
- Applying governance structure in storing messages. Power Automate allows for the customization of storage rules and governance policies, ensuring that chats are archived in a manner consistent with company policies and regulatory requirements.
- Home-grown solution, which can be fully customized and configured per business requirements. Leveraging Microsoft Power Automate for exporting teams chat, businesses can develop a tailored solution that fits their specific needs, without relying on external tools.
- Intuitive UI design for ease of use and better adaptability. The use of Microsoft Power Automate for exporting teams’ chats is not just about the powerful automation it brings. It’s also about providing an intuitive and user-friendly interface that requires minimal training for end-users, enhancing the overall adaptability and effectiveness of the solution.
High-level Requirements
- User-friendly interface to select chat or channel conversation.
- The extracted file should be in PDF format and stored in OneDrive or SharePoint.
- The @mention within the chats should be displayed in blue color.
- Every message header should contain the name, email, date & time. If the user is inactive, then display the name only.
- Extract messages should contain the relevant images/file links.
- Export teams chat (1:1 or Group chat)
- There should be a start and end date option to specify the extracted content range.
- The exported file should contain the start date, end date, and the list of chat members, along with their email IDs.
- Export conversation (Channel Post)
- The header should display.
- Team name
- Channel Name
- All the team members in the format of Name & Email.
- The system should extract the whole conversation thread.
- The main heading and conversation should be displayed on the top, followed by all the replies underneath.
- The header should display.
Solution Architecture
With Microsoft Teams chat export, users gain a powerful tool to secure their conversations, making it easier to comply with legal and policy requirements or keep a record of critical discussions.
- Users submit details via adaptive card.
- Microsoft Power Automate fetches the messages using MS Graph API.
- Message includes Content, Attachments, Images and @mention details.
- After processing the messages, the output is converted to PDF.
- The PDF file is stored in OneDrive, SharePoint, or Both.
- Email notification is sent to the user.
Process Flow
Conclusion
The Microsoft Teams chat export functionality is not available out of the box; hence, the solution helps to save the messages systematically. The solution uniquely stores the messages as records in a configured repository. It’s a comprehensive homegrown solution that can be fully customized per business requirements.