Sharepoint List View Formatting Like Button

%3CLINGO-SUB%20id%3D%22lingo-sub-3020639%22%20slang%3D%22en-US%22%3ESharepoint%20List%20View%20Formatting%20Like%20Button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3020639%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20enabled%20the%20rating%20options%20in%20my%20SharePoint%20List%20and%20SharePoint%20gives%20me%20an%20easy%20to%20use%20heart%20button.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20add%20my%20custom%20JSON%20formatting%20to%20my%20list%2C%20I%20cannot%20figure%20out%20how%20to%20add%20the%20heart%20button.%20I%20can%20add%20in%20details%20such%20as%20Number%20of%20Likes%2C%20and%20who%20has%20liked%2C%20but%20no%20actionable%20button%20that%20adds%201%20like.%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20how%20this%20can%20be%20accomplished%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3020639%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3026772%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20List%20View%20Formatting%20Like%20Button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3026772%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1234182%22%20target%3D%22_blank%22%3E%40TrevorSandidge%3C%2FA%3E%26nbsp%3BMicrosoft%20recently%20introduced%20%3CSTRONG%3EsetValue%3C%2FSTRONG%3E%20in%20JSON%20formatting.%20I%20think%20this%20should%20help%20you%20for%20your%20scenario.%3C%2FP%3E%3CP%3E%3CSTRONG%3EDocumentation%3A%26nbsp%3B%3C%2FSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fformatting-advanced%23set-multiple-field-values-of-an-item-using-customrowaction%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESet%20multiple%20field%20values%20of%20an%20Item%20using%20customRowAction%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20create%20a%20similar%20JSON%20formatting%20sample%20for%20like%2Funlike.%20You%20can%20check%20it%20at%3A%26nbsp%3B%3CA%20title%3D%22like%2Funlike%20list%20item%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2FList-Formatting%2Fpull%2F427%2Ffiles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Elike%2Funlike%20list%20item%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22screenshot.gif%22%20style%3D%22width%3A%20625px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F331179iCC46A097E9D2B3A9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22screenshot.gif%22%20alt%3D%22screenshot.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ESimilar%20samples%3C%2FSTRONG%3E%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2FList-Formatting%2Ftree%2Fmaster%2Fcolumn-samples%2Fmulti-person-reaction%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EReacting%20and%20displaying%20users%20who%20have%20reacted%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2FList-Formatting%2Ftree%2Fmaster%2Fcolumn-samples%2Fgeneric-likedby%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDisplay%20users%20who%20have%20liked%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%3C%2FUL%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%26nbsp%3B%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%26nbsp%3B%26amp%3B%20%3CSTRONG%3ELike%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%3C%2FLINGO-BODY%3E
Visitor

I've enabled the rating options in my SharePoint List and SharePoint gives me an easy to use heart button. 

 

However, when I add my custom JSON formatting to my list, I cannot figure out how to add the heart button. I can add in details such as Number of Likes, and who has liked, but no actionable button that adds 1 like.

Does anyone know how this can be accomplished?

1 Reply

@TrevorSandidge Microsoft recently introduced setValue in JSON formatting. I think this should help you for your scenario.

Documentation: Set multiple field values of an Item using customRowAction 

 

I have create a similar JSON formatting sample for like/unlike. You can check it at: like/unlike list item 

screenshot.gif

 

Similar samples:


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.