How to change ‘Run Flow’ button text when executing a flow from a SharePoint List item

Hello everyone and welcome to my blog. In today’s blog I will discuss an interesting topic. And that is the ability to customize the Power automate flow panel when you execute a Power automate flow from a SharePoint list item record.

In my previous blog I have explained how to create a button column in SharePoint list and launch a Power Automate flow on click of that button in SharePoint List item. I will continue to use the sample example for this blog as well.

Through my blog I share interesting tips and discuss on latest releases of Microsoft.NET technologies, Dynamics 365 and Power Platform, SharePoint and Client scripting libraries. Please subscribe to my blog to stay updated.

This is what the list item looked at the end of my previous blog.

For a quick recap, when I click on ‘Update ticket status‘ button, the flow panel show up.

In this blog I will show how you can change the header text and the button label in the flow panel (areas highlighted in yellow). After all, changing the header and the button ‘Run flow’ text obviously provide a better context for customers.

Let’s see how we can do this. To achieve this, like I did in the previous blog, I first need to navigate to column formatting section of the button column.

Below is the existing JSON formatting for the column. If you are unsure of what is happening here, please check my previous blog.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"fbed7f53-01f3-4e3b-8238-162f082da7be\"}"
  },
  "children": [
    {
      "elmType": "span",
      "attributes": {
        "iconName": "Flow"
      },
      "style": {
        "padding-right": "6px"
      }
    },
    {
      "elmType": "span",
      "txtContent": "Update ticket status"
    }
  ]
}

To change the text of ‘Run Flow‘ button and also customize the header text, I update the above JSON to the following.

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "button",
   "customRowAction": {
      "action": "executeFlow",
      "actionParams": "{\"id\": \"fbed7f53-01f3-4e3b-8238-162f082da7be\", \"headerText\":\"Update Ticket Status\",\"runFlowButtonText\":\"Update status\"}"
   },
   "children": [
      {
         "elmType": "span",
         "attributes": {
            "iconName": "Flow"
         },
         "style": {
            "padding-right": "6px"
         }
      },
      {
         "elmType": "span",
         "txtContent": "Update ticket status"
      }
   ]
}

Check for the section of the json highlighted in bold. I have added couple of properties headerText and runFlowButtonText.

I save the changes. Now when you run the flow, you should be able to see your custom text in header as well as in button label.

Wonderful isn’t it?

I hope this helped. If you have liked the post and if this post has helped you, please subscribe to my blog.

Debajit Dutta

1 thought on “How to change ‘Run Flow’ button text when executing a flow from a SharePoint List item”

  1. Hi,
    as you (correctly) wrote, you have added a couple of properties headerText but the first one is replaced by the second one 😉
    Ciao,
    Sergio

Comments are closed.