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.