SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

Custom CommandBar Links #8723

Open CSteg3 opened 1 year ago

CSteg3 commented 1 year ago

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

Additional environment details

Issue description

I'd like to be able to create command bar links that open up custom hrefs. Would it be possible to add a "custom" key that can then leverage a JSON object's attributes?

{ "commandBarProps": { "commands": [ { "key": "custom", "text": "My Internal App", "position": 0, "iconName": "Calendar", "attributes": { "href": "https://mycustomapp.url" } } ]}}

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

thechriskent commented 1 year ago

This isn't currently possible in List Formatting (as you're aware), but it is possible using a SharePoint Framework Listview Commandset Extension. However, that will provide a command on the list (not per view as in commandBarProps). It also requires solution deployment. It definitely requires more up-front dev skill and administrative overhead, but listview command sets are very powerful and, more importantly for this discussion, are currently the only way to accomplish this.

Having the option of attaching a custom link button to the command bar through formatting would be great. Thanks for submitting the idea!