SOLVED

customRowAction on Document Sets

Copper Contributor

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

5 Replies
best response confirmed by automan25 (Copper Contributor)
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

ganeshsanap_0-1665128645791.png

 


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.

So, that definitely works to open up the form in 'edit' mode. That may work in the end but I was hoping to find a way to open the form in 'view' mode instead.

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

Bit surprising , what would happen if the user doens't have edit rights on the document set. They will be forced to use the OOTB way.

@AshishBaranwal @automan25 

 

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.

1 best response

Accepted Solutions
best response confirmed by automan25 (Copper Contributor)
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

ganeshsanap_0-1665128645791.png

 


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.

View solution in original post