Forum Discussion
LidorD
Mar 05, 2023Copper Contributor
Image column On Select
Hi all, I want to do that when a user is clicking on the image it will view the item and not opening the image in another tab. Is it possible?
- Mar 06, 2023
LidorD You can use JSON column formatting on image column. Use JSON like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "customRowAction": { "action": "defaultClick" }, "children": [ { "elmType": "img", "attributes": { "src": "@currentField.serverRelativeUrl" }, "style": { "width": "100px", "cursor": "pointer" } } ] }
Documentation: Use column formatting to customize SharePoint
Note: You can change styling in above JSON as per your requirement.
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
ganeshsanap
Mar 06, 2023MVP
LidorD You can use JSON column formatting on image column. Use JSON like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"customRowAction": {
"action": "defaultClick"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "@currentField.serverRelativeUrl"
},
"style": {
"width": "100px",
"cursor": "pointer"
}
}
]
}
Documentation: Use column formatting to customize SharePoint
Note: You can change styling in above JSON as per your requirement.
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs