Aug 28 2022 03:26 PM
I am not having luck making this work. How can I use Json to make everyone of my column items in the Link to Item column a button that takes me to this link. Something prettier than this. The column type is a hyperlink and the column name is link to item. Hopefully this is enough information.
Aug 29 2022 01:16 AM - edited Aug 29 2022 01:18 AM
Solution@VeeExcelLearn Use JSON column formatting like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"attributes": {
"href": "@currentField",
"target": "_blank"
},
"style": {
"text-decoration": "none"
},
"children": [
{
"elmType": "button",
"txtContent": "Link to Item",
"style": {
"cursor": "pointer",
"width": "100%"
}
}
]
}
Output:
You can applying CSS styling using available properties given in documentation: formatting-syntax-reference style
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.
Aug 29 2022 03:48 AM
Aug 29 2022 05:26 AM
@VeeExcelLearn I am not getting this error while saving JSON.
Refresh the page & try again saving the JSON formatting.
Please consider giving Like if my post helped you in any way.
Aug 29 2022 01:16 AM - edited Aug 29 2022 01:18 AM
Solution@VeeExcelLearn Use JSON column formatting like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"attributes": {
"href": "@currentField",
"target": "_blank"
},
"style": {
"text-decoration": "none"
},
"children": [
{
"elmType": "button",
"txtContent": "Link to Item",
"style": {
"cursor": "pointer",
"width": "100%"
}
}
]
}
Output:
You can applying CSS styling using available properties given in documentation: formatting-syntax-reference style
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.