Back to column formats
Column formattingSharePoint Online

Teams Message Format

This sample is using Microsoft Teams deep links to create a link that allows a user to send Microsoft Teams messages to the user in the column.

screenshot of the sample
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

3 definitions

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

Column formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "display": "=if(@currentField,'flex','none')",
    "flex-direction": "column"
  },
  "children": [
    {
      "elmType": "div",
      "txtContent": "@currentField.title"
    },
    {
      "elmType": "a",
      "attributes": {
        "href": "='https://teams.microsoft.com/l/chat/0/0?users=' + @currentField.email",
        "target": "_blank"
      },
      "children": [
        {
          "elmType": "div",
          "attributes": {
            "iconName": "TeamsLogo",
            "class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
            "title": "Details"
          },
          "style": {
            "font-size": "24px"
          }
        }
      ]
    }
  ]
}

From the contributor

How to use this sample

Summary

This sample is using Microsoft Teams deep links to create a link that allows a user to send Microsoft Teams messages to the user in the column.

  • person-teams-message-format-name-picture.json

    screenshot of the sample

  • person-teams-message-format-name.json

    screenshot of the sample

  • person-teams-message-format-picture.json

    screenshot of the sample

View requirements

  • This format expects to be applied to a Person column

Sample

Solution Author(s)
person-teams-message-format.json Steve Corey
person-teams-message-format-name.json Steve Corey
person-teams-message-format-picture.json Steve Corey

Version history

Version Date Comments
1.0 September 20, 2023 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.