Forum Discussion

Paul Quirk's avatar
Paul Quirk
Copper Contributor
Jul 08, 2017
Solved

PnP Provisioning engine - Apply to list template type

Is there a way using the PnP provisioning engine, to apply configuration to all lists of a particular template type in a site? i.e. I have a specific configuration that will apply to all document lib...
  • Joseph Ackerman's avatar
    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.

Resources