Sharepoint column json code for email

Chris Kovac 1 Reputation point
2022-09-06T22:23:32.823+00:00

I am not a developer and look for a json script that will format SharePoint columns to email the address in the current column with a subject and body as well as a URL in the body.

Microsoft 365 and Office SharePoint For business Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Renjie Sun-MSFT 2,861 Reputation points Microsoft Employee
    2022-09-07T02:47:43.213+00:00

    Dear @Chris Kovac ,

    Thank you for your post in our forum.

    You could try this column formatting to create an email automatically.

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",  
      "elmType": "div",  
      "children": [  
        {  
          "elmType": "span",  
          "style": {  
            "padding-right": "8px"  
          },  
          "txtContent": "send email"  
        },  
        {  
          "elmType": "a",  
          "attributes": {  
            "iconName": "Mail",  
            "class": "sp-field-quickActions",  
            "href": {  
              "operator": "+",  
              "operands": [  
                "mailto:",  
                "[$address]",  
                "?subject=",  
                "[$subject]",  
                "&body=Hi,",  
                "\r\n\r\n",  
                "[$body]"  
              ]  
            }  
          }  
        }  
      ]  
    }  
    

    The following article is the testing result.

    1. 238369-image.png
    2. Click email button.
      238330-image.png
      Automatically fill the email with column value.

    Should you have any questions or concerns, please do feel free to contact me.

    Yours sincerely,
    Renjie Sun


    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.

    1 person found this answer helpful.

  2. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-09-06T22:53:04.717+00:00

    Hi @Chris Kovac

    This sounds like an automation question. I would recommend you seek expertise with Power Automate to complete this task. You can create an automation script go through a SharePoint list and do what you are looking for.

    Please post this on https://powerusers.microsoft.com/t5/Building-Flows/bd-p/BuildingFlows and someone will try to assist you.

    -----------------------------------------------

    If this is helpful please accept answer.

    0 comments No comments

Your answer

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