Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SharePoint Online JSON script to custom format a person column with a mailto link. This example shows how to convert a column date content to a string. The operators toString() or toLocaleString() could also be used, depending on the desired format output.
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField.title"
},
{
"elmType": "a",
"attributes": {
"iconName": "EditMail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"@currentField.email",
"?subject=Check task status - ",
"[$Title]",
"&body=Please update your task status\r\n---\r\n",
"[$Title]",
"This task is due on: ",
{
"operator": "toLocaleDateString()",
"operands": [
"[$Date]"
]
},
"\r\nThanks."
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.