Oct 12 2023 12:16 AM
Hi, I'm pretty new to sharepoint and I'm wondering if there is a way to directly trigger a flow from my sharepoint web part instead of in the list page.
Right now I have a button in a list to start a flow and it only works in the list page, not the web part. Is there a workaround for this?
Thank you!
Oct 12 2023 01:16 AM
Hi @mingyk,
To trigger a flow from a SharePoint web part you can try to use a Power Apps button.
Here are the steps on how to create a Power Apps button and trigger a flow from a SharePoint web part:
Create a Power Apps button.
Go to Power Apps and create a new canvas app.
Add a button to the app.
In the OnSelect property of the button, add the following code:
Launch( "https://flow.microsoft.com/manage/environments/{EnvironmentName}/flows/{FlowID}/run" );
Replace {EnvironmentName} with the name of the environment where your flow is located and {FlowID} with the ID of your flow.
Save and publish the app.
Embed the Power Apps button in a SharePoint web part.
Create a flow to be triggered by the Power Apps button.
Here are some useful links regarding your issue:
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)