PnP: Add ListTemplates during provisioning in modern SP sites

Iron Contributor

Hi folks,

 

I am digging for some time now but I don't get it. I want to provision modern SPO sites with Site Designs/Site Scripts. To add the option for end users to instantiate lists and libraries that include globally provided content types and fields, I want to include list template as we did this ten years ago with that clunky old feature framework. :) 

 

For now I want to trigger a flow as part of the site script, allowing me to use PnP to  provision these list templates, but I can't find a solution here. Can anyone guide me to a good supported and future-proof way to archive this?

3 Replies
Hey Joel,

thanks for answering. I am completely aware of this article and the pattern described here. That was unfortunately not my question.

My question is how to upload a list template into the list template gallery resp. how to define a list template with PnP for provisioning.
Hi Carsten,
My bad, didn't got your question.
PnP list templates are part of a site template that can have only the list, for example. The problem you have here is that there is no option to make list templates from PnP to appear on the default UI to create lists. You will have to create a custom UI for that.
But this is definitely a common scenario as I have had to do this to more than one client and would be great to have a place where templates could be dropped to automatically be displayed on the UI.

A minimalistic approach would be to have a simple list as the entry point to trigger the provisioning process. Or add a custom SPFx web part on top of the list to give a better UI to end users. You can then use Flow + Azure queue + Function to create a robust process