Create a button to launch a Flow

I’ve recently been on a customer engagement where one of the business requirements was focusing on ease of access for users. The stakeholder wasn’t happy with the out of the box solution to start a flow (Selecting Item > Flow > “Required Flow”)

So I proposed a solution to use Column formatting to create a button for the user to press when they want to trigger the approval flow.

Obtain Flow ID

  • Access https://flow.microsoft.com/
  • Navigate to your flows
  • Select the required flow you want to launch, Copy the ID from the end of the URL and note it down.

Create Column

  • Navigate to Library Settings on the SharePoint Online List.
  • Create a column
  • Enter below JSON and change to your ID which you noted down earlier.

{
“$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 Manager”,
“customRowAction”: {
“action”: “executeFlow”,
“actionParams”: “{\”id\”: \”ID\”}”
}
}
]
}

And it’s that simple.. 🙂

About the author