Created
February 3, 2018 09:50
-
-
Save mrik23/31529a6e489a6d8e2d196f15a08c8ee4 to your computer and use it in GitHub Desktop.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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