Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Hide button in SharePoint list after Power Automate flow started

Posted on January 15, 2023January 15, 2023 by Tom

“I added the button to start a Power Automate flow, but users keep pressing it over and over again, how can I hide it after the flow was started?”


The previous post explained how to add a button to SharePoint list/library to manually trigger a flow. But such button will be visible all the time and users can click on it over and over again. Multiple clicks = multiple flow runs. That’s why you should extend the JSON code a bit – hide the button after the first click, after the flow was started. And this post will show you how.

It’s also worth mentioning that the solution is not limited to hiding a button. You can use the same approach to hide (not disable) any column value based on another column. But for now let’s continue with the button example.

Hiding a column value

Hiding is done by adding a “style” and “display” properties to the JSON code as in the example with hyperlinks.

  "style": {
    "display": "=if(@currentField == '', 'none', 'inherit')"
  }

There’s a condition checking value of a column, and depending on the result it’ll set the “display” property to ‘none’ (hide) or ‘inherit’ (show).

That means you’ll need an extra column with the information whether a user already started a flow. If you’re building an approval flow you can use a status column, e.g. if ApprovalStatus = ‘Not started’.

{
  "$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\"}"
  },
  "style": {
    "display": "=if([$ApprovalStatus] == 'Not started', 'inherit', 'none')"
  }
}

Note: You must always use the column internal name in the JSON code!

Power Automate hide button flow started

If there’s no status to check you can use also a checkbox. With a small adjustment show the button only if the checkbox is not ‘true’.

{
  "$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\"}"
  },
  "style": {
    "display": "=if([$FlowDidRun] != true, 'inherit', 'none')"
  }
}
Power Automate hide button flow started

IMPORTANT: you must always check the checkbox or change the status as the first action in the flow! JSON button can do only 1 action, and this one will trigger the flow…

Summary

If you use a button to start Power Automate flow, you should always hide it once the flow is started. You shouldn’t let user run the flow multiple times, not sure whether the flow already runs. Show them the button only when needed and hide it during the first flow run by updating the ‘control’ column.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

2 thoughts on “Hide button in SharePoint list after Power Automate flow started”

  1. Chris says:
    June 22, 2023 at 5:45 pm

    I have had some difficulty getting my button to hide conditional on a date column. My date column is populated by the approval flow (it is tracking the date the approval started). I only want the button to appear if the date column is empty. Any suggestions?

    Reply
    1. Tom says:
      August 12, 2023 at 11:04 pm

      Hello Chris,
      I’d try:
      “display”: “=if([$columnName] != ”, ‘inherit’, ‘none’)”

      Reply

Leave a Reply Cancel reply

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

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes