Usually, the link to SharePoint list item display form is in this format:
https://contoso.sharepoint.com/sites/siteName/Lists/listName/DispForm.aspx?ID=1
Where 1
is the list item ID
(SharePoint default column).
But unfortunately, SharePoint JSON form formatting does not support fetching item ID ([$ID]
) currently as we can use it in column/view formatting.
Reference: Can ID column be displayed when configuring a list form header using JSON?
So, you will not be able to add link to list item form using JSON formatting using SharePoint out of the box capabilities.
Additional:
You can create send an email link using JSON formatting. Example:
{
"elmType": "div",
"style": {
"width": "100%",
"display": "=if([$Title] && [$AssignedTo.email], 'block', 'none')",
"padding-top": "10px",
"border-top": "1px solid"
},
"attributes": {
"class": "ms-fontColor-neutralSecondary"
},
"children": [
{
"elmType": "a",
"attributes": {
"target": "_blank",
"href": {
"operator": "+",
"operands": [
"mailto:",
"[$AssignedTo.email]",
"?subject=Task status&body=Hey, how is your task (",
"[$Title]",
") coming along?"
]
},
"class": "ms-fontColor-themePrimary"
},
"children": [
{
"elmType": "span",
"txtContent": "Send Email to Task Owner"
},
{
"elmType": "span",
"style": {
"margin-left": "8px",
"vertical-align": "middle"
},
"attributes": {
"iconName": "OutlookLogo",
"class": "ms-fontColor-themePrimary ms-fontSize-xl"
}
}
]
}
]
}
Where AssignedTo
is the internal name of person or group column in the list. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?
Output:
It is not possible to add HTML/hyperlinks in email body using mailto
as it does not support using HTML in email body.
References:
- JSON formatting: make some words inside body text of email bold
- How do I pass HTML table inside mailto in anchor tag?
mailto
button in JSON formatting?