Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with flow
Menu

Add button to start Power Automate flow from SharePoint list

Posted on January 11, 2023January 26, 2023 by Tom

“I’d like to make triggering a Power Automate flow as simple as possible for the users, is there a way to add e.g. a button to start a flow directly from the list view?”


If you use manually started flows, they’re probably started on an item or a document. Users select the item/document, click on the 3 dots -> Automate -> run a flow. But having even these 3 clicks might be confusing for some users, especially if they don’t use flows very often. There must be an easier, more direct way to start a flow!

And there is one, by adding a button directly to the view!

Use JSON formatting to add the button

There’re many possibilities when using JSON to format a SharePoint column. The older posts showed you how to calculate with today’s date or build a hyperlink, this time it’ll show you how to build a button to start a flow.

Since the button will be in a column, it’s a good start to create one, e.g. a Single line of text column ‘StartFlow’.

Click on the column name and navigate through ‘Column settings’ to ‘Format this column’…

…into the ‘Advanced mode’. That’s where all the magic happens.

The JSON below will add the most basic button in that column.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Start flow",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"2c5dfcb2-aa4e-4cfd-9baf-2485225b1fa4\"}"
  }
}

But there’re two parts to modify, one that’s optional and one that’s mandatory to change.

The optional one is the wording on the button in the “txtContent” parameter. You can replace it with a few words on the specific flow, or keep just “Start flow” in there.

Power Automate list start flow button

The second part, the one that’s mandatory to change, is the flow id. You must tell the button what flow it should start, and that’s done by the flow unique id.

Power Automate list start flow button

Open the flow details page and check the url, this id is between the /flows/ and /details part.

Power Automate list start flow button

Copy/paste it into the JSON and save it.

And that’s it, you just created a button that’ll start a flow on a single click.

Summary

When using manually started flows, you might want to make the process as simple as possible for the users. While it’s possible to start Power Automate flow from the item/document context menu, it’s much easier to add a button to the list. Users go to the list, click a single button, and the flow will do the rest. And since it’s done using JSON formatting, you can extend it by other functionality, e.g. hide it once the flow is started, but that’s a topic for another post.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

2 thoughts on “Add button to start Power Automate flow from SharePoint list”

  1. Fernando says:
    January 17, 2023 at 11:21 am

    Super! Thanks a lot! However, I’m struggling with my usecase… I’d like to make actionParams dynamic in function of the row (based on the Title, for example). How could I do it?

    Thanks in advance!

    Reply
    1. Tom says:
      January 26, 2023 at 2:58 pm

      Hello Frenando,
      I never did that and I can’t tell if it’ll work, but I’d try to use the IF condition for the parameters, e.g.
      “action”: “=if([$Title] == ‘Title1’, ‘executeFlow’, ‘setValue’)”

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes