{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"commandBarProps": {
"commands": [
{
"key": "customButton",
"text": "My Custom Button",
"iconName": "Add",
"onClick": {
"action": "defaultClick",
"parameters": {
"url": "https://your-custom-url.com"
}
}
}
]
}
}
Yes, it is possible to add a custom button (such as the "Cancel Request" button you highlighted) to the command bar (navbar) of a SharePoint List form. This can be done by customizing the list using Power Apps or using SharePoint JSON formatting to modify the UI.
Here’s a breakdown of both approaches:
If you switch to using Power Apps to customize the SharePoint list form, you can add custom buttons directly in the app interface:
SharePoint allows you to use JSON formatting to customize the appearance and functionality of list views and command bars (such as adding custom buttons).
Example JSON for a button might look like this:
{
"commandBar": {
"commands": [
{
"key": "customCancelButton",
"text": "Cancel Request",
"iconName": "Cancel",
"onClick": {
"action": "customAction",
"parameters": {
"message": "You clicked the cancel button!"
}
}
}
]
}
}
This JSON code would add a "Cancel Request" button that displays a message when clicked. You could customize the action to suit your requirements (like triggering a workflow or redirecting the user).