/ / Conversation Thread for a Teams List Item

Conversation Thread for a Teams List Item

When you create an item using the Lists app in Microsoft Teams, there’s a handy “Conversation” tab that allows you to have a threaded discussion that shows both for the item and within the main channel window. Unfortunately, Microsoft doesn’t yet have a way to reference or create this conversation thread using Power Automate. But I’ve discovered a workaround, and the following steps will allow you to incorporate the conversation into a tab.

Understand how the conversation thread works

As of March 2021, there’s no official Microsoft documentation about how to reference the Teams conversation associated with a list item. I discovered that there’s no pre-existing message or thread that’s attached to the list item. Instead, there’s a Conversations object that can be updated with a ConversationID equal to the Message Id of a pre-existing Teams message.

Start a thread about the list item

In the channel where you want the Conversation to exist, create an initial post about the list item. You can automate this as a flow in Power Automate when the list item is created. For an example, check out my post about adding a new list item whenever we receive a new Shopify order.

Starting a message thread about a new list item in order to get an initial message ID

Find the list path, channel ID, and team ID

Next, we’re going to compose some JSON to send as HTTP request to SharePoint that will update the Conversations object. You need a few pieces of information first. If you don’t already know the SharePoint path to your list, click on the three dots at the top of the list and “Open in SharePoint.”

Open the list in SharePoint to get the list path

The URL it opens will look something like https://contoso.sharepoint.com/sites/Dev/Lists/Orders/AllItems.aspx?skipSignal=true. The underlined portion is your list path.

To find the channel ID, click the three dots next to the channel and “get link to channel.”

Get a link to the channel to find the channel ID

You should end up with a link that looks something like https://teams.microsoft.com/l/channel/19%3ae15ae352fefa4250a34f396573305d12%40thread.tacv2/Orders?groupId=[whatever]&tenantId=[whatever]. To figure out your channel ID, take the underlined section and replace “%3a” with a colon and “%40” with an at-sign. In this case the channel ID would be 19:e15ae352fefa4250a34f396573305d12@thread.tacv2.

Now click the three dots next to the team name and “get link to team.”

Get a link to the team to find the team ID

You should end up with a link that looks something like https://teams.microsoft.com/l/team/19%3a0a999a2989cd4777b1317977a10d5045%40thread.tacv2/conversations?groupId=[whatever]&tenantId=[whatever]. To figure out your team ID, take the underlined section and replace “%3a” with a colon and “%40” with an at-sign. In this case, the team ID would be 19:0a999a2989cd4777b1317977a10d5045@thread.tacv2.

Note: if this is an old channel, the IDs might say “skype” instead of “tacv2” – this is fine, and the process still works the same.

Compile and format the JSON

The basic structure for the body of the request will be the following:

{
  "listUrl": "[path to SharePoint list]",
  "listItemId": [the ID of the list item you want to assign a conversation to],
  "updatedConversationsObject": "{\"v1\":[{\"conversationId\":\"[message ID]\",\"channelId\":\"[channel ID]\",\"teamId\":\"[team ID]\"}]}"
}

The underlined portions will be the sections you’ll replace. Create a Compose step in your flow after the initial automated message gets posted to Teams, and enter the completed JSON. Use the Dynamic content box to get the list item ID and the Message ID.

Fill in the JSON using the Dynamic content options

Send a request to SharePoint to update the Conversations object

Create a new step in the flow to “Send an HTTP request to SharePoint.”

Create a new action to send an HTTP request to SharePoint

The request should be filled out as follows:

  • Site address: The site where your list resides
  • Method: POST
  • Uri: _api/SP.TeamChannelManager.SaveConversations('')
  • Headers: Content-Type | application/json;odata=verbose
  • Body: Use Dynamic content to retrieve the Outputs of your Compose step
Use Dynamic content to fill in the HTTP request to SharePoint

Save, test, and add a new list item to see what happens!

Success! Now what…

Now your initial message that appeared in the channel also appears in the list item conversation.

The original post appears in the channel.
And now it also appears in the list item conversation!

Additionally, if you comment in the list item conversation, it’ll also appear in the channel.

A new comment in the list item conversation…
Also appears in the Teams channel message thread

Hopefully at some point Microsoft will add a Power Automate action to do this with less fuss, but for the meantime, this will help smooth out your coordination processes. No more searching for the relevant thread; you’ll be able to find it by list item! Now wouldn’t it be nice if you could link directly to the list item from a message in the channel?

Similar Posts

6 Comments

  1. This is exactly what I was looking for! But I can’t get it to work. The result is

    “d”: {
    “SavedConversations”: null
    }

    I checked all the input ID’s using Graph API. The call works, it deletes a manual conversation belonging to the item and replaces it with ‘null’. Any idea on what might go wrong?

  2. This is fantastic, thanks! – I’d like to be able to access the conversation in Teams from the SharePoint list item (outside of the List app) it seems like this would be simple using list formatting if I could access the “conversation” string from within the list. Any thoughts on how to do this?

    1. If you have the ID of the Teams parent message, you can generate a direct link that you could use in a field in the Sharepoint list.

  3. Hey, great post! Thank you so much for sharing.
    I just wanted to point out that this works in standard channels and not private channels.
    If you want to do the same in a private channel, just replace the TeamID by the ChannelID. That means that the ChannelID appears twice in your request, like this:

    {
    “listUrl”: “[path to SharePoint list]”,
    “listItemId”: [the ID of the list item you want to assign a conversation to],
    “updatedConversationsObject”: “{\”v1\”:[{\”conversationId\”:\”[message ID]\”,\”channelId\”:\”[channel ID]\”,\”teamId\”:\”[channel ID]\”}]}”
    }

    This worked for me. Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *