Can you start a Power Automate Flow on selected SharePoint item? Yes!
You mean, not when an item is created or updated, but on-demand? Yes, of course!
Power Automate gives you a trigger "SharePoint --> For a selected item" using which you can trigger workflow on a selected SharePoint List Item or Document.
You can run the Flow from the ribbon after selecting an item. Additionally, you can even add a button in the view which can be clicked to invoke the Flow.
Below image shows how to run Flow on a selected SharePoint item from the Ribbon. Click anywhere on the list item or document to select it --> Click "Automate" from the Ribbon --> click on the name of your Flow to trigger it.
✌️ Steps to create button in SharePoint view to trigger Flow
Let's assume we have a SharePoint list for projects. Project needs to be approved before it starts execution. We have a workflow (Flow) for approval and should be started when approval button is clicked for corresponding project.- Create a single line of text column 'Approval' in your SharePoint list (or with any other desired name).
- Click Column Settings.
- Click Format this Column.
- Paste JSON code given below in the text box.
- Click Preview to made adjustments as needed. Click Save.
- Click button "Start Approval" (you can have your own message on the button) against any list item. This will launch a panel in the right section of the screen with an option to run the flow.
- Click "Run flow" to trigger the workflow on selected item.
Make sure you replace value "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" with your actual Flow Id.
How to find the id of Flow created in Power Automate ?
Go to Power Automate --> My flows --> Click corresponding Flow --> copy the GUID from the URL after flows/
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"}"
},
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"border": "1px black solid",
"background-color": "orange",
"cursor": "pointer",
"margin": "4px",
"color": "white",
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Flow"
},
"style": {
"padding-right": "6px"
}
},
{
"elmType": "span",
"txtContent": "Start Approval"
}
]
}
⚡️ Conditionally show/hide button in SharePoint view
Is it possible to show the button only when a condition is met, say status=Submitted, and hide the button when a condition is not met?
Yes - add the "visibility" attribute to the "Style" section to update the CSS and toggle the display based value in a given column.
As an example, let us display the button only when the project status is Submitted. Add below line to your JSON code in Style. This checks if the value for Status filed is Submitted and sets the visibility of the button to visible/hidden.
"visibility": "=if(([$Status] == 'Submitted'),'visible','hidden')"
⛔️ InvokerConnectionOverrideFailed error
If you receive below error when clicking on the button, most probably you are using "Manually trigger a flow" trigger in your Flow. Remove the manual trigger and use the SharePoint - "For a selected item" trigger.
Failed to parse invoker connections from trigger 'manual' outputs. Exception: Could not find property 'headers.X-MS-APIM-Tokens' in the trigger outputs. Workflow has connection references '["shared_wordonlinebusiness","shared_sharepointonline"]' with invoker runtime source.
Have Questions? Post them here!
- Move Copy Migrate SharePoint OneDrive files folders to different site collection location
- How to generate client id and secret to register SharePoint App with OAuth
- How to share SharePoint site or document with all users in organization
- Get-ADUser PowerShell - Get AD user details using email address
- error CAML Query containing special characters
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Fix SharePoint Error - The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started
- SharePoint - The URL is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
- How to delete SharePoint List Item programmatically using C#.Net
- How to Share Microsoft SharePoint Site with Users or Groups
- JSON column formatting to preview SharePoint Online file on mouse hover
- SharePoint List redirect user after submitting form NewForm.aspx
- See actual SharePoint error exception modify web.config
- SharePoint Server 2016 IT Preview Deprecated Removed features
- How to create SharePoint Document Library
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell
- How to disable SharePoint subsite creation option for owners
- PowerShell - How to use Try Catch Finally blocks for error exception handling (Windows/SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help. (OSE403)
- [Solved] SharePoint Search Internal server error exception
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- Changed AD user display name showing old name in SharePoint
- How to hide or remove quick launch left navigation from SharePoint Online Modern site page
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- Microsoft Lists and SharePoint Online edit grid view - use undo and redo changes - SharePoint
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command - Bash
- How to Show Path of Files or App in Mac Spotlight Search - MacOS
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar - MacOS
- Java JDBC Get Id of the Inserted Record with AutoIncrement - Java
- Keyboard Shortcut to delete a file on a Mac [Macbook] - MacOS
- Release Date and iPhone Devices that will Support iOS 16 - iOS
- Write JSON to file in pretty-printed Format using Java Jackson - Java