SOLVED

Create a site from template and attach Flow programmatically/via script

%3CLINGO-SUB%20id%3D%22lingo-sub-328037%22%20slang%3D%22en-US%22%3ECreate%20a%20site%20from%20template%20and%20attach%20Flow%20programmatically%2Fvia%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-328037%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20create%20a%20site%20from%20a%20template%20and%20automatically%20attach%20a%20flow%20to%20one%20of%20the%20lists%20that%20would%20be%20included%20in%20the%20site%20template.%20It%20looks%20like%20I%20can%20use%20this%20link%20as%20a%20starting%20point%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F52486.office-365-auto-provision-site-assets-in-sharepoint-online-using-pnp-provisioning-templatesmicrosoft-flow-and-azure-functions.aspx%23Summary%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F52486.office-365-auto-provision-site-assets-in-sharepoint-online-using-pnp-provisioning-templatesmicrosoft-flow-and-azure-functions.aspx%3C%2FA%3E%2C%20but%20it%20doesn't%20go%20into%20programmatically%20attaching%20a%20flow%20to%20a%20list.%20I%20thought%20I%20had%20read%20something%20about%20adding%20a%20flow%20to%20a%20list%20via%20script%20(or%20flow%20or%20something)%2C%20but%20I%20can't%20find%20anything%20on%20it%20now%20when%20I%20search.%20Hopefully%20that%20all%20makes%20sense%2C%20but%20please%20let%20me%20know%20if%20it's%20unclear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20done%20anything%20like%20this%3F%20Can%20you%20offer%20any%20links%20for%20adding%20a%20flow%20to%20a%20list%20via%20script%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-328037%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-443501%22%20slang%3D%22en-US%22%3ERe%3A%20Create%20a%20site%20from%20template%20and%20attach%20Flow%20programmatically%2Fvia%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-443501%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62058%22%20target%3D%22_blank%22%3E%40Jason%20Barnes%3C%2FA%3E%26nbsp%3Bhow%20did%20you%20achieve%20updating%20the%20trigger%20to%20point%20at%20your%20new%20list%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-328235%22%20slang%3D%22en-US%22%3ERe%3A%20Create%20a%20site%20from%20template%20and%20attach%20Flow%20programmatically%2Fvia%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-328235%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20anyone%20finds%20this%20later%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20programmatically%20create%20flows.%20Read%20more%20about%20the%20specific%20action%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fconnectors%2Fflowmanagement%2F%23create-flow%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fconnectors%2Fflowmanagement%2F%23create-flow%3C%2FA%3E%20and%20the%20announcement%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fflow.microsoft.com%2Fblog%2Fplanner-triggers-connector-improvements%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fflow.microsoft.com%2Fblog%2Fplanner-triggers-connector-improvements%2F%3C%2FA%3E%20The%20API%20is%20also%20now%20documented%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fflow%2Fweb-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fflow%2Fweb-api%3C%2FA%3E%20so%20you%20can%20use%20whatever%20tools%20you%20want%20to%20create%20or%20update%20flows%20programatically.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fpowerusers.microsoft.com%2Ft5%2FFlow-Ideas%2Fprogrammatically-create-a-flow%2Fidi-p%2F112491%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESource%3C%2FA%3E%3C%2FEM%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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-ass..., 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? 

2 Replies
Highlighted
Best Response confirmed by Jason Barnes (Contributor)
Solution

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. 

 

Source 

@Jason Barnes how did you achieve updating the trigger to point at your new list?