Forum Discussion
PnP Provisioning engine - Apply to list template type
- Jul 10, 2017
I would recommend a different approach.
Instead of trying to apply your changes with one call to the template, add a parameter to the template for the list name and use the parameter in the template element where it is attempting to apply the change.
Then use the site context to get all lists in the web site, test each one for its type (so you are only working on Document Libraries), and then apply the template to those that match your criteria, passing in the name of the "current" doc lib.
Basically, loop through all the lists in your site, calling applytemplate() multiple times, once for each doc lib you want to change.
I would recommend a different approach.
Instead of trying to apply your changes with one call to the template, add a parameter to the template for the list name and use the parameter in the template element where it is attempting to apply the change.
Then use the site context to get all lists in the web site, test each one for its type (so you are only working on Document Libraries), and then apply the template to those that match your criteria, passing in the name of the "current" doc lib.
Basically, loop through all the lists in your site, calling applytemplate() multiple times, once for each doc lib you want to change.
- Paul QuirkAug 04, 2017Copper ContributorGenerally works pretty well. But what I've kind of found is that running applytemplate multiple times on the same web takes a while. I'm trying to find a way to dynamically add the existing lists in a web to the template to apply any required settings to them.
- Paul QuirkJul 24, 2017Copper ContributorThanks for that. That is pretty much the approach I'd come up with.
I've created a provisioning template with the settings I want that has a parameter "ListTitle" for the ListInstance title parameter. It works excellent for PowerShell, which is one of the use cases I'm using it in.
Just struggling how to do the same in CSOM.- Paul QuirkJul 24, 2017Copper Contributor... and I think I got CSOM bit too.
Once I have the template object, I can add the Parameter to that, as suggested here: https://github.com/SharePoint/PnP-Sites-Core/issues/831