Part 01 (This article)
Microsoft Flow together with PowerApps undoubtedly revolutionizing the process automation in modern work places. You may have a Flow attached to a document library or list but there is no easy access to initiate that flow from the list/library itself. People have to dig in a little bit to initiate it and that’s a little bit of time consuming for constant usage.
With this article, we will find out how we can overcome this struggle using a little bit of JSON stuff (Don’t worry about that word, you don’t need to be a developer here). Using the Modern SharePoint capabilities, we can embed a button right in front of every item in a list or library so that people can trigger a Flow right there. New column formatting is a cool out of the box capability to get this done.
Now let’s get this started. First and foremost, you need to have a Flow created in place and have the GUID of it.
We’ll get a Flow created really quick in case if you don’t have one. If you have a Flow already in place, you can skip these basic steps
Open up your SharePoint Library and click on the “Flow” drop down on the ribbon as below. Then go to “Create a Flow”
You’ll see a list of available templates. You can utilize these templates if your requirement matches with them. Or simply feel free to create your own. Thankfully, there are a lot of templates published by Microsoft and the community which you can re-use on various scenarios. Unless the requirement is very specific or you are really keen on creating one your own, there is no point of designing a Flow from the scratch.
I am adding a simple “Request Manager Approval” flow here. Pretty straight forward.
Next, go ahead and check if the flow is added to “My Flows” section. If so, you are good to go.
Now go inside the created Flow by clicking on it and copy the highlighted GUID form the address bar of your browser. We need this for our new Button.
Now to add the button but before that we need a new column for this button. From the list or library, go to the very end horizontally and add a new text column to this list/library.
It should be like below after adding. You can edit this view by dragging and dropping the desired column across the library if you wish to. I’m calling mine “Approval” so it makes scenes for a column contains buttons.
Now, go ahead and format this column. Click on the little arrow on the newly created column and go to format mode.
And paste the JSON code below. replace the GUID using the target flow which you have copied to the clip board.
Here’s the code (you will have it provisioned as you go to format mode itself).
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "span", "style": { "color": "#0078d7" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Flow" } }, { "elmType": "button", "style": { "border": "none", "background-color": "transparent", "color": "#0078d7", "cursor": "pointer" }, "txtContent": "Send to Approval", "customRowAction": { "action": "executeFlow", "actionParams": "{\"id\": \"e290feff-0013-41f2-97dd-91a37fb84ea0\"}" } } ] }
That’s it and you will immediately notice the button applied to your column. This is how my library looks like after adding the button. It still doesn’t look like a button because of the border, background and colors of it.
Cool thing is ! you can customize the button to look like as you want it to be. Further more, you can also make it a logical button which has a condition behind it. (e.g. – show a button only when an item pending for approval).
Read the part 02 of this article series to further customize the button and apply conditions.
Detailed Microsoft article for this is here
DISCLAIMER NOTE: This is an enthusiast post and is not sponsored by Microsoft or any other vendor.
if I share the folder link with the personalized button, it will be showed but the flow doesn’t star.
How could the flow set to be executed by a person (not in the organization) that know the folder link?
the solution does not have an approval status column, which would be really helpful.
Great solution! Thanks a lot 😉
when inserting this list as webpart, the colum does not show the link/button ;(
Pingback: Convert Office Files in to PDFs using Microsoft Flow – Microsoft Cloud Services & Technology Journal
Pingback: Add a button in to a SharePoint List/Library to trigger a Flow (part 02-customization) – Microsoft Cloud Services & Technology Journal