PnP Provisioning template using JSOM?

%3CLINGO-SUB%20id%3D%22lingo-sub-108594%22%20slang%3D%22en-US%22%3EPnP%20Provisioning%20template%20using%20JSOM%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108594%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20some%20javascript%20that%20creates%20a%20new%20sub-web%20but%20I%20would%20like%20the%20site%20to%20be%20a%20copy%20of%20an%20existing%20%22template%22%20site.%20I%20will%20eventually%20move%20this%20to%20TypeScript%20and%20a%20SharePoint%20Framework%20web%20part.%3C%2FP%3E%0A%3CP%3EIs%20there%20any%20way%20of%20using%20the%20Provisioning%20Engine%20in%20javascript%2Ftypescript%20to%20do%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109352%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%20Provisioning%20template%20using%20JSOM%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109352%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20what%20I%20thought%20but%20wanted%20to%20ask%20just%20in%20case%20I%20was%20missing%20something.%20Thanks%20for%20the%20info!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109175%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%20Provisioning%20template%20using%20JSOM%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109175%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20far%20as%20I%20know%20there%20is%20no%20javascript%20library%20for%20the%20PnP%20engine.%20PnP%20javascript%20library%20can%20be%20used%20to%26nbsp%3Bhelp%20you%20configure%20the%20new%20site%20but%20it%20doesn't%20have%20functionality%20to%20work%20based%20on%20a%20template%20file.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20a%26nbsp%3Blots%20of%20other%20options%20but%20all%20involve%20using%20powershell%20or%20c%23%20code%3A%3C%2FP%3E%3CP%3E%26nbsp%3B-%20Integrate%20with%20PnP%20partner%20pack%3C%2FP%3E%3CP%3E%26nbsp%3B-%20Populate%20a%20list%20with%20site%20info%20which%20than%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20-%20is%20queried%20by%20a%20powershell%20script%20to%20perform%20provisioning%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20-%20triggers%20a%20webhook%20or%20RER%20to%20perform%20the%20provisioning%3C%2FP%3E%3CP%3E%26nbsp%3B-%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20probably%20looking%20for%20a%20clientside%20solution...%20Then%20your%20best%20bet%20is%20do%20all%20provisioning%20by%20code%20instead%20of%20using%20a%20template.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

I have some javascript that creates a new sub-web but I would like the site to be a copy of an existing "template" site. I will eventually move this to TypeScript and a SharePoint Framework web part.

Is there any way of using the Provisioning Engine in javascript/typescript to do this?

2 Replies
Highlighted

As far as I know there is no javascript library for the PnP engine. PnP javascript library can be used to help you configure the new site but it doesn't have functionality to work based on a template file. 

 

There are a lots of other options but all involve using powershell or c# code:

 - Integrate with PnP partner pack

 - Populate a list with site info which than

    - is queried by a powershell script to perform provisioning

    - triggers a webhook or RER to perform the provisioning

 - etc.

 

You are probably looking for a clientside solution... Then your best bet is do all provisioning by code instead of using a template.

Highlighted

That's what I thought but wanted to ask just in case I was missing something. Thanks for the info!