0

I am new to PnP. I have an existing site collection in SharePoint Online, however I want to add site columns and create new custom lists in it through template.xml. I do not want to change anything else in the site collection. I have tried using the xml example in GitHub but it is for the entire site. Please let me know how to proceed.

1

The new PnP provisioning engine is used for the enter site. Using it, you can model a site by configuring the design of Site Columns, Content Types, List Definitions and Instances, Composed Looks, Pages (either WebPart Pages or Wiki Pages), and much more, via your web browser. When you are done with the design, you can export what you have done into a persistent provisioning template format (XML, JSON, or whatever you like), and you can apply that template to as many target sites as you would like. Learn more about PnP provisioning engine.

You can use New-PnPList to create a new list in SharePoint Online.

demo: PnP PowerShell to create a list in SharePoint Online

And use Add-PnPField to add a field as a site column.

Or, you can use CSOM to create list/site column in SharePoint Online.

Demo of creating list using PowerShell in SharePoint Online

Demo of creating Site column using PowerShell in SharePoint Online

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.