Forum Discussion
Create a site from template and attach Flow programmatically/via script
I need to create a site from a template and automatically attach a flow to one of the lists that would be included in the site template. It looks like I can use this link as a starting point: https://social.technet.microsoft.com/wiki/contents/articles/52486.office-365-auto-provision-site-assets-in-sharepoint-online-using-pnp-provisioning-templatesmicrosoft-flow-and-azure-functions.aspx, but it doesn't go into programmatically attaching a flow to a list. I thought I had read something about adding a flow to a list via script (or flow or something), but I can't find anything on it now when I search. Hopefully that all makes sense, but please let me know if it's unclear.
Has anyone done anything like this? Can you offer any links for adding a flow to a list via script?
If anyone finds this later:
You can programmatically create flows. Read more about the specific action here: https://docs.microsoft.com/connectors/flowmanagement/#create-flow and the announcement here: https://flow.microsoft.com/blog/planner-triggers-connector-improvements/ The API is also now documented here: https://docs.microsoft.com/flow/web-api so you can use whatever tools you want to create or update flows programatically.
- Jason BarnesBrass Contributor
If anyone finds this later:
You can programmatically create flows. Read more about the specific action here: https://docs.microsoft.com/connectors/flowmanagement/#create-flow and the announcement here: https://flow.microsoft.com/blog/planner-triggers-connector-improvements/ The API is also now documented here: https://docs.microsoft.com/flow/web-api so you can use whatever tools you want to create or update flows programatically.
- GristyBrass Contributor
Jason Barnes how did you achieve updating the trigger to point at your new list?