SOLVED

Need to be able to click on SharePoint list column to open form

%3CLINGO-SUB%20id%3D%22lingo-sub-1857755%22%20slang%3D%22en-US%22%3ENeed%20to%20be%20able%20to%20click%20on%20SharePoint%20list%20column%20to%20open%20form%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1857755%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20be%20able%20to%20click%20on%20a%20user%20in%20the%20PEOPLE%20column%20to%20open%20the%20form.%26nbsp%3B%20I'll%20be%20getting%20rid%20of%20the%20Title%20column%20and%20need%20an%20efficient%20way%20to%20open%20up%20the%20details%20for%20an%20item%20by%20clicking%20on%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-11-05_11-24-51.png%22%20style%3D%22width%3A%20854px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231708i71E550E4DF11A729%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222020-11-05_11-24-51.png%22%20alt%3D%222020-11-05_11-24-51.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1857755%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Lists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859853%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20to%20be%20able%20to%20click%20on%20SharePoint%20list%20column%20to%20open%20form%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859853%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F12706%22%20target%3D%22_blank%22%3E%40Rick%20Brock%3C%2FA%3E%26nbsp%3BYou%20can%20use%20below%20JSON%20to%20open%20the%20default%20form%20on%20click%20of%20person%20name%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22button%22%2C%0A%20%20%22txtContent%22%3A%20%22%40currentField.title%22%2C%0A%20%20%22customRowAction%22%3A%20%7B%0A%20%20%20%20%22action%22%3A%20%22defaultClick%22%0A%20%20%7D%2C%0A%20%20%22style%22%3A%20%7B%0A%20%22border%22%3A%20%22none%22%2C%0A%20%22background-color%22%3A%20%22inherit%22%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EReference%3C%2FSTRONG%3E%3A%20%3CA%20title%3D%22button%20elements%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fcolumn-formatting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ebutton%20elements%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20Using%20this%20JSON%2C%20you%20will%20loss%20the%20default%20hover%20action%20of%20person%20or%20group%20field%20(where%20you%20can%20see%20user%20details).%20Maybe%20adding%20some%20more%20JSON%20code%20you%20can%20achieve%20hover%20also.%20check%20above%20link%20for%20more%20information%20on%20column%20formatting.%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

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.

 

2020-11-05_11-24-51.png

3 Replies
best response confirmed by Rick Brock (New Contributor)
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.

 

@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:

Default hover card on Lists 

 

Please like my responses if it helped you to solve your issue.