cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fanny
Advocate IV
Advocate IV

Add flow for getting Teams conversation

We want to get the Teams conversation history. But there is no way to do this, then we hope can add a Flow to get the conversation then send to email.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi Fanny,

 

Currently, it seems that we don’t have a way to get Teams conservation history, I haven’t seen a similar request at Flow Ideas Forum, please consider to create a new one at here:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

I will help collect and report it from my side.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yamao-msft
Community Support
Community Support

Hi Fanny,

 

Currently, it seems that we don’t have a way to get Teams conservation history, I haven’t seen a similar request at Flow Ideas Forum, please consider to create a new one at here:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

I will help collect and report it from my side.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Eliot
Advocate II
Advocate II


@Fanny wrote:

We want to get the Teams conversation history. But there is no way to do this, then we hope can add a Flow to get the conversation then send to email.


Hey, @Fanny , sorry if this is way out of time!

 

Is this now handled with the "Get messages" (currently in preview) action?

 


EDIT

OK, @Fanny, It *kind of* is. Smiley Wink

 

So, you can use the 'Get messages' in any existing flow, to get the entire channel (I think - happily corrected!), as per the YouTube video further down.

 

However, now, there's literally a trigger event in Flow. So, you can have a flow run *whenever* a new message is posted in to Teams. I have it log every new message in a channel with this:

  1. Build an 'Automated flow'.
    • Select the trigger; 'When a new channel message is added'.
  2. Fill the Trigger fields.
    • Fill the Team field.
    • Fill the 'Channel' field.
  3. Run HTML to text, to store the message text in plain text.
    • 'Content' = "Message body content" (Teams)
  4. 'Create item' (in a SharePoint list)
    • 'Title' = "The plain text content." (Html to text)
    • 'fullTxt' = "Message body content" (Teams)
    • 'teamsMsgID' = "Message id" (Teams)
    • 'flowRunTime' = "utcNow()" (MS Flow fx)
  5. That's it!

Hope this helps, I've left the rest of my original message below. Of course I'll be adding more functionality to my one, but you get the idea from the above. My brief testing is that it works just fine. But I suspect there's probably a bit of throttling for multiple messages quick in succession. Will try to report on any funny stuff.


If not, my bad, but I think you can produce a daily export to whatever Flow can send to and in any format (JSON) you like, using a scheduled daily action.

 

( caveat - figured that this needed someone to say it for anyone that's searching and finding this particular post ... sorry if there are 'bumping' rules, please do DM me if I'm breaking them. )

 

If / when (it's actually in my interests to make this work, since Teams chats aren't typically backed up by backup firms) I actually get this working, I'll try to either come back to this thread, and/or I'll link to the working example.

 

In the meantime, this (official-ish) youtube video does have a (slightly over egged) description of how to achieve this.

 

EDIT 2

So. It appears that 'replies' are a dark art, and are not queriable by the flow connector. So, 'kinda' is still true, but you can't grab a whole channel.

 

I'm going to rewatch the above video.

 

I've commented elsewhere about how obfuscated the Teams chat is, in terms of accessibility (specifically for backing up), but this shouldn't be as difficult as it seems to be. All the same, apparently the full (public) chats are all kept in a hidden exchange folder that's created with the 'Teams mailbox when it is first initiated. Find that first and beat the gold rush!

 

Best

Eliot - projectfive

CFernandes
Super User
Super User

You can use the  Microsoft Teams 'Get Messages' action and export Team conversation. From a high level your flow would look like the screenshot below. You can find the details instructions at https://clavinfernandes.wordpress.com/2020/07/11/exportarchive-daily-teams-chat-using-power-automate...

 

image-10

 

Another way is to use the Graph API endpoints, to GET message in a channel‘ and also 'Get the replies to the Message' . In Power Automate you can use the  ‘Invoke an HTTP request’ (screenshot below).

 

image-3

 

image-10

 

You can find more details at https://clavinfernandes.wordpress.com/2020/05/04/exporting-chats-from-microsoft-teams-using-power-au...

 

 

 

 

 

 

 

bombledmonk
Regular Visitor

This is solved in an edge case, but if you don't have admin you can't set the permissions for graph api you can't use the solution above.   Getting replies is just as necessary as getting messages to the core experience of Power Automate + Teams. It'd definitely be nice if they'd add replies into the native experience, like so many features, it's really hard to imagine why it's missing, but there must be a reason.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (10,976)