How to Create a Button Inside a SharePoint List
How to Create a Button Inside a SharePoint List
SharePoint Online provides powerful list customization capabilities through JSON column formatting. One popular requirement is creating buttons directly inside SharePoint Lists that allow users to perform actions such as opening URLs, launching forms, triggering workflows, or navigating to related records.
Using JSON formatting, you can transform a standard column into an interactive button without writing custom code or deploying SharePoint Framework solutions.
Why Create Buttons in SharePoint Lists?
- Improve user experience
- Provide quick actions
- Reduce navigation steps
- Launch external applications
- Trigger business processes
Create a Button Using JSON Formatting
Apply the following JSON formatting to a SharePoint column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Open",
"style": {
"background-color": "#0078d4",
"color": "white",
"border": "none",
"padding": "6px 12px",
"border-radius": "4px"
},
"customRowAction": {
"action": "defaultClick"
}
}
This creates a clickable button inside each row of the SharePoint List.
Open a URL from a Button
You can also configure the button to open a URL stored in a column.
{
"elmType": "a",
"txtContent": "View",
"attributes": {
"target": "_blank",
"href": "[$Website]"
}
}
Customize Button Appearance
JSON formatting allows you to customize colors, fonts, borders, and icons.
"style": {
"background-color": "#107c10",
"color": "white",
"font-weight": "bold"
}
Important: JSON column formatting is supported only in modern SharePoint experiences and requires appropriate list permissions.
How to Apply JSON Formatting
- Open your SharePoint List.
- Select the target column.
- Click Column Settings.
- Select Format This Column.
- Choose Advanced Mode.
- Paste the JSON code.
- Save the changes.
Common Use Cases
- Open documents
- Launch Power Apps forms
- Open external websites
- Navigate to related records
- Approval actions
- Workflow shortcuts
Best Practices
- Use meaningful button labels.
- Keep button styling consistent.
- Test formatting in multiple browsers.
- Validate URLs before deployment.
- Follow SharePoint UI guidelines.
Key Takeaways
- JSON formatting can create buttons inside SharePoint Lists.
- No custom development is required.
- Buttons can open URLs and perform actions.
- Improves user experience and productivity.
- Works seamlessly in modern SharePoint Online.