Forum Discussion
Add action buttons per row in the document library / List to minimize clicks
- Jun 22, 2026
To improve usability and reduce the number of clicks for end users, we can add inline action buttons (such as Open, Edit, Share, and Copy Link) directly against each item in the SharePoint document library using JSON column formatting.
This approach allows users to access commonly used actions with a single click, instead of navigating through the command bar or context menu.
JSON Formatting (Column Formatting):
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "display": "flex", "gap": "8px" }, "children": [ { "elmType": "button", "style": { "background-color": "#0078d4", "color": "white", "border": "none", "padding": "4px 8px", "border-radius": "4px", "cursor": "pointer" }, "attributes": { "title": "Open" }, "customRowAction": { "action": "defaultClick" }, "children": [ { "elmType": "span", "attributes": { "iconName": "OpenFile" } } ] }, { "elmType": "button", "style": { "background-color": "#107c10", "color": "white", "border": "none", "padding": "4px 8px", "border-radius": "4px", "cursor": "pointer" }, "attributes": { "title": "Edit" }, "customRowAction": { "action": "editProps" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Edit" } } ] }, { "elmType": "button", "style": { "background-color": "#5c2d91", "color": "white", "border": "none", "padding": "4px 8px", "border-radius": "4px", "cursor": "pointer" }, "attributes": { "title": "Share" }, "customRowAction": { "action": "share" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Share" } } ] }, { "elmType": "button", "style": { "background-color": "#d83b01", "color": "white", "border": "none", "padding": "4px 8px", "border-radius": "4px", "cursor": "pointer" }, "attributes": { "title": "Copy link" }, "customRowAction": { "action": "copyLink" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Link" } } ] } ] }
It's certainly possible (and not difficult) to add clickable buttons into your list or library. You add a single line of text column and then format it with JSON. Normally this would be to trigger a flow, set the value of an item in the row, do inline edits and many more actions.
You can also format views with JSON view formatting.
What you can do is not unlimited but you can see the different possibilities at
https://pnp.github.io/List-Formatting/columnsamples/
Rob
Los Gallardos
Microsoft Power Platform Community Super User
Principal Consultant, Power Platform, WSP Global (and classic 1967 Morris Traveller driver)