Forum Discussion
drmrbrewer
Sep 28, 2023Copper Contributor
Format calculated column as hyperlink to navigate like the Name column
I have a calculated column which is populated with content from my custom Subject column, and if that is blank then it falls back to what is in the standard Name column (or a tracked version of that,...
- Sep 29, 2023
drmrbrewer Try using this JSON:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "attributes": { "class": "ms-Link" }, "customRowAction": { "action": "defaultClick" } }
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
ganeshsanap
Sep 29, 2023MVP
drmrbrewer I am not sure if you can make it visible on hover similar to default Name column but you can use below JSON which will show (...) next to column value always and open the context menu on click of the icon:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": "ms-Link"
},
"customRowAction": {
"action": "defaultClick"
}
},
{
"elmType": "span",
"style": {
"margin-left": "15px",
"font-size": "16px",
"cursor": "pointer"
},
"attributes": {
"iconName": "More"
},
"customRowAction": {
"action": "openContextMenu"
}
}
]
}
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
drmrbrewer
Sep 29, 2023Copper Contributor
Thanks! This gives me a good starting point for further customisation.