SOLVED

Sharepoint launch flow whilst in document library web part

Copper Contributor

Hi

I have a SharePoint document library with a button that launches a flow. This works with no problems when viewed directly from the document library.

 

My site has various pages where the document library is viewed via the document library web part. When the button to lunch the flow is clicked whilst viewing via the document library web part, the flow will not start - nothing happens.

 

Is it possible to get flows to work when a user views the document library via the document library web part?

 

Any help would be much appreciated. Thank you.

5 Replies
best response confirmed by Sam_Green (Copper Contributor)
Solution

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!

Thank you@Kelly_Edinger 

 

Yes, that has worked as a workaround, not perfect. Don't suppose there is anyway to hide the command bar or see all button when using embed web part?

 

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-formattin...) 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.

Many thanks @Kelly_Edinger this was a great help.
For reference for anyone who is looking to embed a document library, I have found that when you view a pdf within the embedded library it only opens within that embedded library window. This means that the pdf document is small (yes you can zoom in but are still working with a small space). Visio and URL links open in new tabs.

When using the standard document library web part a pdf although still embedded opens in a new tab making it a better reading experience.

I am now trying to find a way of forcing pdfs in a embedded window to open in a new tab.
1 best response

Accepted Solutions
best response confirmed by Sam_Green (Copper Contributor)
Solution

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!

View solution in original post