Hi @Ramon03 ,
I'm afraid it is not supported to to create a button in the list using JSON column formatting to open attachements in SharePoint Online.
When using Button
elements in your JSON code, Button
elements can be used to launch a specific action on the parent item. Every button
element has a required property, customRowAction
, that specifies an action
that's taken when the button is clicked. This action must be one of the following values:
- defaultClick
- share
- delete
- editProps
- openContextMenu
- executeFlow
Please take a reference to this article and the article contains detailed description of the function of each value: button elements. The action
property is set as below in the JSON formatting code of the delete button.
"customRowAction": {
"action": "delete"
}
However, the action
values such as opening attachments are not provided currently. As a result, it is impossible to open the attachment via a button using JSON formatting. As an alternative, you can build your SharePoint Framework (SPFx) Extensions to inject CSS/JS code to the list to achieve your requirement.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.