Add an Action Button to a field for sending an Email in SharePoint List/Library using JSON

In this SharePoint tutorial, We will discuss how to add an Action Button to a field for sending an Email in SharePoint List using JSON. The same action Button you can use for SharePoint Library also.

Add an Action Button for sending an Email in SharePoint List

To add this Send an Email action Button into the list column, Follow the below steps:

Step-1:

First of all, Create a SharePoint List or Library. Here in the below screenshot, I have created a Task list named as “EmployeeTask”. In the task list, there will be a default column present as”Assigned To”.

Note: If you are creating a Custom list, Make sure that your List column will be “Person”. Then only it will work.

add an action Button to a field in SharePoint List using JSON
add an action Button to a field in SharePoint List using JSON

Step-2:

Now to add this Send Email action button, Click on to the “Assigned To” drop-down column. Then choose “Format this column” and click it like the given screenshot.

sharepoint column formatting json examples
sharepoint column formatting json examples

Step-3:

After clicking “Format this column”, A format column text box will appear in the existing page where you have to add the JSON Code for Sending the Email action button. In the below screenshot, I have added the JSON Code and then click on “Save” button.

If you want to preview this JSON Code, then click on “Preview” and view the List. You can follow this below JSON Code.

JSON Code:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField.title"
},
{
"elmType": "a",
"attributes": {
"iconName": "Mail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"@currentField.email",
"?subject=Task status&body=Hey, how is your task coming along?.\r\n—\r\n",
"@currentField.title",
"[$ID]"
] }
}
}
] }
how to add an action Button to a field in SharePoint List or library using JSON
how to add an action Button to a field in SharePoint List or library using JSON

Step-4:

Now in the below screenshot, You can see the “Assigned To” column will appear with the Mail box icon.

sharepoint online column formatting json examples
sharepoint online column formatting json examples

Step-5:

Once you will click on the Mail box icon, It will direct open the Outlook Email as below. By using this Mail Box icon, You can easily Email to others without navigating to other page.

add an action Button to a field in SharePoint List using JSON
add an action Button to a field in SharePoint List using JSON

You may like following SharePoint list and library tutorials:

In this article, we discussed how to add an Action Button to a field for sending an Email in SharePoint List or Library using JSON.

  • Hi, may I know why is it not function to my JSON column formatting in SharePoint 2019 even though I copy the same coding as above? Would appreciate of you could advise on this.

  • Hello, this will open the browser page and not outlook to send the email? I am using a person field, I see the mail icon and click, and it opens my browser to Google…Help

  • >