Forum Discussion
Sharepoint launch flow whilst in document library web part
- Oct 23, 2023
Hi Sam -it's a limitation that it won't run via the button as a doc library web part. However, I just tested in my dev environment by using the Embed web part instead and adding the URL of the library. Worked like gold!
From all the documentation I've found, it's not possible to hide the entire command bar, however you can hide menu items in the command bar. I followed this video (https://www.youtube.com/watch?v=sZYZnJGQgcI) and syntax reference (https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting) to hide most items on the command bar for the initial view, and then hid 'pin' and 'rename' from the command bar once a document was selected. I created a separate view and used that URL for the embed web part so I could still access the entire menu in the standard all items view.
This is what my JSON looks like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalRowClass": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "%",
"operands": [
"@rowIndex",
2
]
},
0
]
},
"sp-css-backgroundColor-BgLightGray30",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "%",
"operands": [
"@rowIndex",
2
]
},
1
]
},
"sp-css-backgroundColor-noFill",
""
]
}
]
},
"commandBarProps": {
"commands": [
{
"key": "new",
"hide": true
},
{
"key": "upload",
"hide": true
},
{
"key": "editInGridView",
"hide": true
},
{
"key": "sync",
"hide": true
},
{
"key": "upload",
"hide": true
},
{
"key": "export",
"hide": true
},
{
"key": "automate",
"hide": true
},
{
"key": "integrate",
"hide": true
},
{
"key": "pinToQuickAccess",
"hide": true
},
{
"key": "addShortcut",
"hide": true
},
{
"key": "alertMe",
"hide": true
},
{
"key": "manageAlert",
"hide": true
},
{
"key": "pinItem",
"hide":true
},
{
"key": "rename",
"hide":true
}
]
}
}
I hope that helps a bit.