cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Trigger a flow with sharepoint button

Hi, 

How can I trigger a Flow by pressing a SharePoint button? Is it posible whitout Power apps?

Thanks

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Trigger a flow with sharepoint button

@Sergio_Carol yes this can be done without Power Apps using a combination of a flow and JSON column formatting of the list column. We use this a lot in our lists & libraries at my company.

For the button you will need a single line of text column in your list:

0-SP-List.png

In your flow use a SharePoint of For a selected file (if the button is in a library) or For a selected item (if it's in a list):

1-ForSelectedFile.png

 When you've saved your flow copy the id of the flow from the address bar:

2-flowID.png

Back in your SharePoint list you need to format the column where the button will be and go to Format this column:

3-formatColumn.png

Then add in the JSON code below, changing the id to your flow's ID:
4-JSON.png

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Publish to Teams",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"021ec4e0-8f85-46b3-a557-a4456960a4eb\"}"
  },
  "style": {
    "background-color": "#468259",
    "color": "white",
    "visibility": "=if(([$PublishedToTeams] == 'Yes'),'hidden','visible')"
  }
}

 

I've added a background color and changed the font color and also added a condition that only displays the button my column PublishedToTeams is not equal to Yes. But you don't need that to make the button work - the default styling is shown in the Email column next to the Teams column. You will need to change the text on the button and this is done on the txtComment line. When you press click the button the flow will run - you will be asked to confirm the run each time.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

 

Highlighted
Regular Visitor

Re: Trigger a flow with sharepoint button

Thank you @RobElliott

 

I understand (more or less 😀) your answer but my problem is in a SharePoint web button, not in a library or list. I think I only can use a URL link.

 

 

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (9,004)