Nov 05 2020 08:32 AM
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.
Nov 05 2020 11:03 PM
Solution@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.
Nov 06 2020 07:07 AM
@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!
Nov 06 2020 10:09 AM
@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.
Oct 14 2022 06:35 AM
Oct 14 2022 06:41 AM
@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.