Oct 06 2022 11:28 AM
I have a library of document sets. I would like my end users to be able to see the View Form (not the Properties Pane) for a particular document set with a single click. Normally the view form can be pulled up by digging through the context menu and selecting More and then Properties. This will be too confusing for the end users though. In order to achieve this I set up a custom column and added formatting to that column to add a 'view' button (see video link below). If this was a list item I could use the 'defaultClick' command under 'customRowAction' to trigger the opening of the view form, but for a document set that doesn't work; rather it triggers the opening of the document set.
Can anyone think of a way to open the view form with a single click?
For reference, here is the video showing how to add buttons to custom column using column formatting:
https://www.youtube.com/watch?v=Kjwovfsw0d8&t=288s
Oct 07 2022 12:44 AM
Solution@automan25 You can open the document set properties on button click using editProps action.
For example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "View Properties",
"customRowAction": {
"action": "editProps"
}
}
Output:
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.
Oct 07 2022 09:50 AM
Oct 07 2022 09:56 AM
@automan25 Unfortunately, there is no action available in JSON formatting to open it in view mode.
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.
Nov 21 2023 06:05 AM
Nov 21 2023 07:54 AM
You can try using defaultClick action in customRowAction property. Example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "View Properties",
"customRowAction": {
"action": "defaultClick"
}
}
defaultClick: buttons with this action will do the same thing as clicking the list item in an uncustomized view. Above is an example of a button that, when clicked, simulates a click on the item, which results in opening the list item. Adding this example button to a document library simulates a click on the file or folder, which results in the file or folder being opened.
Please consider giving a Like if my post helped you in any way.
Oct 07 2022 12:44 AM
Solution@automan25 You can open the document set properties on button click using editProps action.
For example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "View Properties",
"customRowAction": {
"action": "editProps"
}
}
Output:
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.