Share via

Microsoft Dynamics 365 Overview

Martin, Heidi (SE GP T SP PS) 571 Reputation points
2023-07-18T10:35:32.05+00:00

Hello,

maybe someone can help me. I have a SharePoint column and a JSON code stored here. But I want that in the email not only at Subject: the Title is but also the start date (so another column "Start"). Unfortunately I can't get it to work. Thank you!

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "span",
      "style": {
        "padding-right": "20px"
      },
      "txtContent": "@currentField.title"
    },
    {
      "elmType": "a",
      "attributes": {
        "iconName": "Mail",
        "class": "sp-field-quickActions",
        "href": {
          "operator": "+",
          "operands": [
            "mailto:",
            "[$Attendees.email]",
            "?Bcc=xxxx.com",
            "[$BCC]",
            "&subject=",
            "[$Title]",
            "&body=",
            "Dear XXX,",
            "\r\n \r\n",

          ]
        }
      }
    }
  ]
}
Microsoft 365 and Office | SharePoint | For business | Windows

Answer accepted by question author

Emily Du-MSFT 51,986 Reputation points Microsoft External Staff
2023-07-19T07:32:38.7133333+00:00

To involve Start column in the email subject, you should first convert date value in the Start column into text value.

1.Create a calculated column named Startdate with below formula.

=TEXT([Start],"YYYY-MM-DD")

2.Using JSON codes to involve Start column in the email subject

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "span",
      "style": {
        "padding-right": "20px"
      },
      "txtContent": "@currentField.title"
    },
    {
      "elmType": "a",
      "attributes": {
        "iconName": "Mail",
        "class": "sp-field-quickActions",
        "href": {
          "operator": "+",
          "operands": [
            "mailto:",
            "[$Attendees.email]",
            "?Bcc=xxxx.com",
            "[$BCC]",
            "&subject=",
            "[$Title]",
            ",",
            "[$Startdate]",
            "&body=",
            "Dear XXX,",
            "\r\n \r\n"
          ]
        }
      }
    }
  ]
}

3.Result:

User's image


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.