Forum Discussion
Rick Brock
Nov 05, 2020Copper Contributor
Need to be able to click on SharePoint list column to open form
I need to be able to click on a user in the PEOPLE column to open the form. I'll be getting rid of the Title column and need an efficient way to open up the details for an item by clicking on it.
Rick Brock You can use below JSON to open the default form on click of person name:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "@currentField.title", "customRowAction": { "action": "defaultClick" }, "style": { "border": "none", "background-color": "inherit" } }
Reference: button elements
Note: Using this JSON, you will loss the default hover action of person or group field (where you can see user details). Maybe adding some more JSON code you can achieve hover also. check above link for more information on column formatting.
Please click Mark as Best Response 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.
Rick Brock You can use below JSON to open the default form on click of person name:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "@currentField.title", "customRowAction": { "action": "defaultClick" }, "style": { "border": "none", "background-color": "inherit" } }
Reference: button elements
Note: Using this JSON, you will loss the default hover action of person or group field (where you can see user details). Maybe adding some more JSON code you can achieve hover also. check above link for more information on column formatting.
Please click Mark as Best Response 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.
- Awesome390Copper ContributorAlthough this post is a few years old now, can I combine title and a 2nd column to click to open a form?
Awesome390 Are you trying to open list form on click of two separate columns? Title and another column? What is the column/data type of 2nd column?
Anyway, you can add above JSON code on any column and it should open the list form on click.
Note: You have to change the "txtContent" value based on column type. Single line of text, choice, number, etc. columns work with "@currentField".
Please consider giving a Like if my post helped you in any way.
- Rick BrockCopper Contributor
ganeshsanap Thank, you! This is exactly what I was needing. As you state, it does get rid of the default hover action :(. I'll see if I can find a way to combine the code.
Thanks for your quick reply and the information you provided!Rick Brock You are welcome.
Check below JSON sample for you reference to show hover card on person or group field:
Please like my responses if it helped you to solve your issue.