/ / Direct Deep Links to List Items in Teams

Direct Deep Links to List Items in Teams

In previous posts, I’ve shown you how to track items in the Lists app in Microsoft Teams. I’ve also demonstrated how to send an automated request to the channel and add a message thread to the conversation tab. However, what if you want to link directly to the list item within that notification so that it’s easier for the reader to see more details? Microsoft has a capability called “deep linking” that allows us to do this in a few steps:

Understand why to deep-link

Let’s say you view a specific list item in Microsoft Teams and and use the “copy link” option in the top right. If you paste that into a Teams message, it should take you directly back to that list item within the list tab in Teams, right?

Copying a link to a list item from within Microsoft Teams

Wrong; it’ll take you to the list item on your SharePoint site in your browser. It gets the job done, but not in the way you were expecting.

The link from Teams kicks you into SharePoint in your browser

The point of deep-linking is that it will take you directly to the list item in a specified context. In this case, I’ll demo how to deep-link to this particular order within a tab in a given channel in Teams. For more context, you can read Microsoft’s deep-linking documentation.

Get the format for the deep link

The basic format before URL encoding for a deep link to a list item is https://teams.microsoft.com/l/entity/<appId>/<entityId>?context={"subEntityId":"<listItemId>","channelId":"<channelId>"}. The easiest way to get most of the information you need is to copy a link to the tab itself:

Use the three dots in the upper right corner to copy a link to the list tab

You’ll end up with something like https://teams.microsoft.com/l/entity/999c2873-6023-480c-a11b-76b66605ce8c/_djb2_msteams_prefix_9996828625?context=%7B%22subEntityId%22%3Anull%2C%22channelId%22%3A%2219%3A999ae999efa4250a8bf999d43305dcc%40thread.tacv2%22%7D&groupId=99969855-b11b-42c5-b093-277724b5ad68&tenantId=999df92-cb82-9999-a35f-c280c72f7b45. The underlined portion is the URL-encoded version of the deep link. The only part that’s missing is the list item number.

Find the list item number and add it to the deep link

To get the list item number, check out that original SharePoint link from the first step. There should be a section of that link that looks like DispForm.aspx?ID=5, meaning the list item number would be 5 in this case. Alternatively, you can change the settings of the list to show the list item ID as a column.

To add the list item ID, replace null in the deep link with %22<listItemId>%22 — so in this case it would be %225%22. The final product in this example comes out to https://teams.microsoft.com/l/entity/999c2873-6023-480c-a11b-76b66605ce8c/_djb2_msteams_prefix_9996828625?context=%7B%22subEntityId%22%3A%225%22%2C%22channelId%22%3A%2219%3A999ae999efa4250a8bf999d43305dcc%40thread.tacv2%22%7D, where the underlined portion is where you updated the null subEntityId.

You can now manually post this link in a Teams message and it will give you a direct link to the list item in the list’s tab.

Automate deep-linking in a Teams message

This gets easier if you add it to a Power Automate flow. To demonstrate, I’m going to add a deep link to an order list item when I post a notification to the channel that the item has been added. First, I’m going to move my original message into a Compose action so that it’s a little easier to work with, and use the output to post the message. The “Title” is actually the order number, and that’s the part we’re going to link to the list item.

The original HTML message has been moved into a Compose action
Current output of the “Post a message” action

Using the deep link information I gathered above, I’ve added link to the Title portion. Instead of replacing null with a specific list item ID, I’ve used the “ID” dynamic content to fill in that portion automatically. Note: don’t forget to add the %22 to each side of the ID; these are URL-encoded quotation marks, so they’re critical to the syntax.

Add the ID dynamic content to the deep link

Now when I run this same flow, the notification message links directly to the list item within the Orders list tab in the Orders channel.

Order number links directly to list item
What you see after clicking the link

Success! Any new order message that gets posted to the channel will now be deep-linked to the correct context within Teams, and won’t kick out back out to SharePoint in your browser. This will help unify the entire Lists app experience within Microsoft Teams.

Similar Posts

11 Comments

  1. Hello. Thank you for sharing the great tips! It worked, but when the message was posted by Power Automate, the conversation history in the thread was gone. How is it in your environment?
    Thank you.

      1. Sorry, I posted it on another topic by mistake.
        Yes, I mean the list item conversation.

        I wanted to connect the post to the previous conversation history.
        Thank you.

        1. Unfortunately I don’t know of a way to automatically combine Teams threads. You basically have to select which thread you’d like to have associated with the list item conversation, and give the list item the message ID of that thread.

  2. i did follow the same steps but unfortunately deep link is only opening the tab not the specific item.
    Am i doing something wrong?

Leave a Reply

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