pnp / blog

holds all blogs published on the Microsoft 365 Platform Community blog
https://pnp.github.io/blog
MIT License
74 stars 106 forks source link

Create and Retrieve Power Automate Flows - WITH CODE!!! :-) #1739

Closed utterances-bot closed 8 months ago

utterances-bot commented 9 months ago

Create and Retrieve Power Automate Flows - WITH CODE!!! :-)

As you are probably aware, Microsoft is looking to eliminate SharePoint 2010 and 2013 workflows.

https://pnp.github.io/blog/post/create-and-retrieve-power-automate-flows-with-code/

psorbi commented 9 months ago

While there is a solutionid property on the Workflow table, all Flows end up in the default solution. If you want a Flow to appear in a solution, you have to create a Solution Component record to relate the Flow to the Solution. https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/addsolutioncomponent?view=dataverse-latest

heiangus commented 2 months ago

@psorbi If you want to add your flow to a solution, just add the system name of the solution to the MSCRM.SolutionUniqueName header in your reques. PHP Curl example:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'MSCRM.SolutionUniqueName: MoveworksFlows', 'Authorization: Bearer '.$token));