Home >Tips >Introduction to PnP Generator kalmstrom.com site map icon Site map  

Create SharePoint List with the PnP Generator

A kalmstrom.com Tools tutorial

PowerShell iconWith the free kalmstrom.com service  SharePoint PnP List Generator, you can create new SharePoint lists with new content types in a way that follows recommended practices.

The generator builds a PowerShell script for the list from the values for content type and site columns that the user enters in the form. List data can also be added.

When everything is entered, copy the PowerShell code, paste it in Windows PowerShell ISE and run it, and the new list is quickly created.
  1. Enter the name of a content type group. It can be a new or an existing group.
  2. Enter the URL to the SharePoint site where you want the new list to be created.
  3. Select SharePoint version.
  4. Select PowerShell version.
  5. Select Parent content type.
  6. Enter the name of the new content type you want to create.
  7. Enter the name of the new list.
  8. Enter the names of the site columns and specify the column types.
  9. (Enter data to be added to the list.)
  10. Copy the PowerShell code.
  11. Run Visual Studio Code (PowerShell V7) or Windows PowerShell ISE (PowerShell V5) as an administrator.
  12. Open a new script and paste the PowerShell code you copied from the PnP Generator.
  13. Make any changes you prefer in the script.
  14. Run the script. Now the list will be created in the SharePoint site you specified in the PnP List Generator.
Peter Kalmström, CEO and Systems Designer of kalmstrom.com Business Solutions, shows the process in the demo below. Peter also explains what the PowerShell script does and where you can see the different steps in the code.

Note that the demo was created with an earlier version of the generator, which only supported PowerShell version 5 and SharePoint Online, and therefore no selection was necessary. Otherwise, the process to fill out the generator is similar. However, PowerShell version 7 is run and edited in Visual Studio Code, while version 5 uses Windows PowerShell ISE.

The steps above describes the current version of the PnP List Generator, and you can see it in the first demo in the import article.


Remove-All

If you need to start over we recommend running the Remove-All function at the end of the PnP List Generator PowerShell code. That function removes everything and lets you start over from scratch.

Note that the Remove-All function removes everything, as the name implies. The content type, the site columns, the list and the list items are all gone after you have run this code. The code also empties the recycle bin, so there will be no restoring items if you change your mind. This is a power-user tool, use it with caution.

Import data

As data can be added to the SharePoint PnP List Generator, it is also useful if you want to import data into SharePoint from Excel or another table and when you want to create a better SharePoint list to replace an existing one. In another demo, Peter shows how to import an Excel spreadsheet to a SharePoint list with the PnP Generator.

 

Learn more






Products Buy FAQ Services Tips Books Contact About Us Tools

Security and integrity

Copyright  Kalmstrom Enterprises AB  All rights reserved