SharePoint & Microsoft 365

Run a Power Automate Flow from a SharePoint Library Button

Use SharePoint column formatting and the supported executeFlow action, with solution-aware flow IDs, permission checks and a safe asynchronous fallback.

Collab365 Team · 23 April 2026 · Updated 24 August 2026 · 3 min read

Use SharePoint column formatting's supported executeFlow action to show a button for a list item or document. Put the flow in the correct environment, obtain its flow identifier, paste that ID into the JSON, and test the button as a normal user.

Do not expose a raw HTTP-trigger URL in column-formatting JSON as a shortcut. Page visitors can inspect the JSON, and a URL is not a safe substitute for a deliberate authentication and authorisation design.

Prerequisites

You need:

  • permission to edit the list or library view or column formatting
  • a Power Automate flow intended to run for the selected SharePoint item
  • permission to access and share that flow appropriately
  • the correct Power Platform environment
  • licences for the connectors and capabilities used by the flow
  • a test item that contains no sensitive production data

The button does not grant the user access to the item, flow, connections or downstream system.

1. Build and test the flow first

Create the flow in the environment where it will run. If it belongs to an application lifecycle management process, create it inside a solution and use connection references.

Make the first test harmless. For example, update a dedicated test field or write a trace record. Add checks for missing item IDs, unexpected file types and users who should not perform the action.

2. Get the flow identifier

Microsoft's column-formatting procedure provides separate paths for solution-aware and non-solution-aware flows.

For a solution-aware flow:

  1. open the environment
  2. open Solutions
  3. select the solution and flow
  4. choose Export, then Get flow identifier
  5. copy the identifier

For a non-solution flow, open the flow in the correct environment and use the same Get flow identifier command.

3. Add the button JSON

Create or choose a text column to display the action. Open Column settings, select Format this column, then use Advanced mode.

Replace the example ID:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Send for review",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"REPLACE-WITH-FLOW-ID\"}"
  },
  "style": {
    "border": "none",
    "background-color": "transparent",
    "color": "#005a9e",
    "cursor": "pointer",
    "font-weight": "600"
  }
}

Microsoft documents optional headerText and runFlowButtonText values for the panel. Keep the first version simple.

For solution-aware flows, Microsoft says the launch panel appears and the user selects Run Flow. Flow behaviour can differ for non-solution-aware flows, so verify the exact user interaction in your tenant.

4. Test as the intended user

Test:

  1. the button appears in the library itself
  2. the same view works in any Document Library web part where it will be used
  3. the normal user can open the item
  4. the launch panel names the intended flow
  5. the flow receives the intended item
  6. the expected result occurs once
  7. a failure leaves a visible, recoverable state

Do not rely on a site-owner test. Owners can mask missing permissions and sharing problems.

When direct launch is not suitable

If you need a simple asynchronous request, a formatted button can use the documented setValue action to change a field such as ActionRequested. A flow triggered by item modification can then act only when that field has the required value.

This pattern needs:

  • a trigger condition that references the field's internal name
  • idempotency so the same request is not processed twice
  • a processing status and error status
  • a deliberate reset or completion value
  • protection against the flow retriggering itself

Microsoft documents setting field values with customRowAction. It is not an excuse to hide sensitive authorisation decisions in client-side JSON.

Common failures

  • No button: validate the JSON and confirm it is applied to the displayed column and view.
  • The wrong flow opens: obtain the identifier from the correct environment.
  • The flow cannot run: check sharing, connections, data policies and licensing.
  • It works in the library but not a page web part: reproduce with the exact view and web part, then use the supported library surface while investigating. Do not publish an unauthenticated endpoint.
  • Duplicate runs: add an idempotency key or processing state and review trigger conditions.

Proof boundary

A successful test proves that one user, item, view and set of connections worked. It does not prove all users have access or that premium, gateway, data-loss-prevention and downstream permissions are correct.

Sources

For more dependable SharePoint-triggered automations, join the Power Automate Builders Space.