Sharepoint button to run a Power Automate flow.

%3CLINGO-SUB%20id%3D%22lingo-sub-2249294%22%20slang%3D%22en-US%22%3ESharepoint%20button%20to%20run%20a%20Power%20Automate%20flow.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249294%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20pulling%20my%20hair%20out%20here.%20(Well%2C%20what%20little%20I%20have%20left!)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20very%20new%20to%20Sharepoint%20Online%20%2F%20O365.%26nbsp%3B%20But%20I%20have%20sucessfully%20used%20Power%20Automate%20to%20create%20a%20flow%2C%20which%20collects%20file%20metadata%2C%20asks%20for%20a%20filename%20and%20uploads%20the%20file%20to%20a%20SharePoint%20Doc%20Library.%26nbsp%3B%20This%20works%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20I%20want%20to%20fire%20this%20by%20hitting%20a%20button%20on%20my%20Sharepoint%20site.%26nbsp%3B%26nbsp%3B%20I%20create%20the%20button%2C%20but%20I%20cannot%20find%20anywhere%20where%20it%20tells%20me%20the%20URL%20of%20the%20flow%20I've%20created!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20tell%20me%20where%20this%20is%20hidden%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2249294%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2249365%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20button%20to%20run%20a%20Power%20Automate%20flow.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249365%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20still%20new%20myself%20and%20have%20a%20similar%20question.%20As%20with%20most%20Microsoft%20things%2C%20you%20may%20need%20to%20devise%20a%20nonsensical%20workaround.%20Here's%20the%20best%20solution%20I've%20been%20able%20to%20integrate%20into%20our%20workflow.%3CBR%20%2F%3E%3CBR%20%2F%3EInstall%20and%20sign%20into%20the%20Power%20Automate%20app%20on%20your%20phone.%20You%20should%20find%20your%20button%20on%20the%20Buttons%20page.%20Select%20%5B%20...%20%5D%20and%20choose%20Share%20Button%20Link.%20This%20will%20give%20you%20a%20url%20to%20access%20your%20workflow.%20Copy%20this%20url%20and%20open%20it%20on%20your%20computer's%20web%20browser.%3CBR%20%2F%3EDepending%20on%20where%20you%20want%20this%2C%20you%20can%20usually%20find%20a%20place%20in%20SharePoint%20to%20create%20a%20link%20using%20this%20url.%20I%20have%20a%20weblink%20in%20a%20SharePoint%20Document%20Library%20which%20I've%20pinned%20to%20the%20top%20of%20the%20library%20for%20easier%20access.%20I%20also%20have%20the%20link%20on%20various%20buttons%20on%20our%20Hub%20Site%20homepage.%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20my%20knowledge%2C%20someone%20please%20tell%20me%20otherwise%2C%20the%20Power%20Automate%20app%20is%20the%20only%20place%20to%20find%20the%20url%20to%20the%20button.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2249374%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20button%20to%20run%20a%20Power%20Automate%20flow.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249374%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F474866%22%20target%3D%22_blank%22%3E%40SimonMarkEdwards%3C%2FA%3E%26nbsp%3Bit's%20not%20a%20url%20you%20need%2C%20it's%20the%20ID%20of%20the%20flow.%20You%20get%20this%20from%20the%20main%20screen%20of%20the%20flow%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221-Flow-ID.png%22%20style%3D%22width%3A%20854px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F268921iE854A52E894B1FF8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221-Flow-ID.png%22%20alt%3D%221-Flow-ID.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20your%20button%20is%20in%20a%20document%20library%20or%20the%20Site%20Pages%20library%20then%20the%20trigger%20in%20your%20flow%20needs%20to%20be%20%22For%20a%20selected%20file%22.%20If%20the%20button%20is%20in%20a%20list%20then%20the%20trigger%20should%20be%20%22For%20a%20selected%20item%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20then%20need%20a%20single%20line%20of%20text%20column%20in%20your%20list%2Flibrary%20and%20format%20it%20with%20the%20JSON%20below.%20You'll%20see%20the%20ID%20on%20the%20actionsParams%20line%3B%20you'll%20need%20to%20change%20this%20to%20your%20flow's%20ID%20and%20also%20change%20the%20header%20text%20and%20run%20flow%20button%20text%20to%20whatever%20you%20want%20and%20also%20change%20the%20txtContent%20line%20(the%20text%20on%20the%20button).%20And%20of%20course%20you%20change%20the%20style%20to%20however%20you%20want%20it%20to%20look.%20You'll%20notice%20that%20I've%20got%20the%20visibility%20as%20conditional%20based%20on%20another%20column%20(set%20to%20Yes%20in%20the%20flow)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22button%22%2C%0A%20%20%22txtContent%22%3A%20%22Publish%20to%20Teams%22%2C%0A%20%20%22customRowAction%22%3A%20%7B%0A%20%20%20%20%22action%22%3A%20%22executeFlow%22%2C%0A%20%20%20%20%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%20%5C%22021ec4e0-8f85-46b3-a557-a4456960a4eb%5C%22%2C%5C%22headerText%5C%22%3A%5C%22All%20Things%20REI%5C%22%2C%5C%22runFlowButtonText%5C%22%3A%5C%22Publish%20Now%5C%22%7D%22%0A%20%20%7D%2C%0A%20%20%22style%22%3A%20%7B%0A%20%20%20%20%22background-color%22%3A%20%22%23008082%22%2C%0A%20%20%20%20%22color%22%3A%20%22white%22%2C%0A%20%20%20%20%22border-radius%22%3A%20%220%2015px%22%2C%0A%20%20%20%20%22visibility%22%3A%20%22%3Dif((%5B%24PublishedToTeams%5D%20%3D%3D%20'Yes')%2C'hidden'%2C'visible')%22%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20end%20result%20of%20the%20above%20formatting%20looks%20like%20this.%20Click%20the%20button%20and%20flow%20will%20start%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220-SPList.png%22%20style%3D%22width%3A%20865px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F268922i335F721A2898E447%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220-SPList.png%22%20alt%3D%220-SPList.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20that%20has%20prevented%20you%20going%20bald.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User.%3CBR%20%2F%3EIf%20I've%20answered%20your%20question%20or%20solved%20your%20problem%2C%20please%20mark%20this%20question%20as%20answered.%20This%20helps%20others%20who%20have%20the%20same%20question%20find%20a%20solution%20quickly%20via%20the%20forum%20search.%20If%20you%20liked%20my%20response%2C%20please%20consider%20giving%20it%20a%20thumbs%20up.%20Thanks.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2256485%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20button%20to%20run%20a%20Power%20Automate%20flow.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2256485%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40RobElliott%3C%2FA%3E%26nbsp%3B%26nbsp%3B%20Thanks%20Rob.%20Most%20helpful.%26nbsp%3B%20All%20I%20need%20now%20is%20something%20to%20make%20the%20hair%20grow%20back.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2465319%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20button%20to%20run%20a%20Power%20Automate%20flow.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2465319%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40RobElliott%3C%2FA%3E%26nbsp%3B%2C%20Great%20article%2C%20and%20I%20really%20like%20your%20buttons!%3CBR%20%2F%3EI've%20been%20trying%20this%2C%20but%20the%20button%20shows%20in%20every%20row%2C%20regardless%20the%20content%20of%20the%20column%26nbsp%3BShareBim360.%3CBR%20%2F%3EAny%20idea's%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22%24schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22elmType%22%3A%20%22button%22%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22Share%20to%20Bim360%22%2C%3CBR%20%2F%3E%22customRowAction%22%3A%20%7B%3CBR%20%2F%3E%22action%22%3A%20%22executeFlow%22%2C%3CBR%20%2F%3E%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%20%5C%22bce75e04-998b-4600-b829-7370d6a2ee15%5C%22%2C%5C%22headerText%5C%22%3A%5C%22All%20Things%20REI%5C%22%2C%5C%22runFlowButtonText%5C%22%3A%5C%22Publish%20Now%5C%22%7D%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22style%22%3A%20%7B%3CBR%20%2F%3E%22background-color%22%3A%20%22%23008082%22%2C%3CBR%20%2F%3E%22color%22%3A%20%22white%22%2C%3CBR%20%2F%3E%22border-radius%22%3A%20%220%2015px%22%2C%3CBR%20%2F%3E%22visibility%22%3A%20%22%3Dif((%5B%24ShareBim360%5D%20%3D%3D%20'Yes')%2C'hidden'%2C'visible')%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%2C%20Roland%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I am pulling my hair out here. (Well, what little I have left!)

 

I am very new to Sharepoint Online / O365.  But I have sucessfully used Power Automate to create a flow, which collects file metadata, asks for a filename and uploads the file to a SharePoint Doc Library.  This works fine.

 

Now I want to fire this by hitting a button on my Sharepoint site.   I create the button, but I cannot find anywhere where it tells me the URL of the flow I've created!

 

Can anyone tell me where this is hidden?

4 Replies

I'm still new myself and have a similar question. As with most Microsoft things, you may need to devise a nonsensical workaround. Here's the best solution I've been able to integrate into our workflow.

Install and sign into the Power Automate app on your phone. You should find your button on the Buttons page. Select [ ... ] and choose Share Button Link. This will give you a url to access your workflow. Copy this url and open it on your computer's web browser.
Depending on where you want this, you can usually find a place in SharePoint to create a link using this url. I have a weblink in a SharePoint Document Library which I've pinned to the top of the library for easier access. I also have the link on various buttons on our Hub Site homepage.

To my knowledge, someone please tell me otherwise, the Power Automate app is the only place to find the url to the button.

@SimonMarkEdwards it's not a url you need, it's the ID of the flow. You get this from the main screen of the flow as follows:

 

1-Flow-ID.png

 

If your button is in a document library or the Site Pages library then the trigger in your flow needs to be "For a selected file". If the button is in a list then the trigger should be "For a selected item".

 

You then need a single line of text column in your list/library and format it with the JSON below. You'll see the ID on the actionsParams line; you'll need to change this to your flow's ID and also change the header text and run flow button text to whatever you want and also change the txtContent line (the text on the button). And of course you change the style to however you want it to look. You'll notice that I've got the visibility as conditional based on another column (set to Yes in the flow):

 

 

{
  "$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\",\"headerText\":\"All Things REI\",\"runFlowButtonText\":\"Publish Now\"}"
  },
  "style": {
    "background-color": "#008082",
    "color": "white",
    "border-radius": "0 15px",
    "visibility": "=if(([$PublishedToTeams] == 'Yes'),'hidden','visible')"
  }
}

 

 

The end result of the above formatting looks like this. Click the button and flow will start:

0-SPList.png

 

I hope that has prevented you going bald.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
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.

@RobElliott   Thanks Rob. Most helpful.  All I need now is something to make the hair grow back.

@RobElliott , Great article, and I really like your buttons!
I've been trying this, but the button shows in every row, regardless the content of the column ShareBim360.
Any idea's?


{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Share to Bim360",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"bce75e04-998b-4600-b829-7370d6a2ee15\",\"headerText\":\"All Things REI\",\"runFlowButtonText\":\"Publish Now\"}"
},
"style": {
"background-color": "#008082",
"color": "white",
"border-radius": "0 15px",
"visibility": "=if(([$ShareBim360] == 'Yes'),'hidden','visible')"
}
}

Thanks, Roland