Home >Tips >Import data with PnP Generator kalmstrom.com site map icon Site map  

Import Data to SharePoint with the PnP Generator

A kalmstrom.com Tools tutorial

PowerShell iconThe free kalmstrom.com service  SharePoint PnP List Generator, creates new SharePoint lists in a way that follows recommended practices. It is also convenient to use the generator to import data to SharePoint.

Add all data together with values for the new list's content type and site columns to the PnP Generator, and it will create a PowerShell script for the list.

Copy the PowerShell code, paste it in Visual Studio Code or Windows PowerShell ISE (depending om PowerShell version) and run the script. Now the new list is quickly created with all the data.
  1. In the kalmstrom.com PnP List Generator, 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. Under Site Columns, type column names under the Title cell, or copy and paste them from the existing data source. Select the column types you wish to use.
  9. Copy the rest of the data from the source. Select the first cell under under List Data in the PnP Generator and paste the data. Check that it looks good.
  10. Click on Copy to Clipboard.
  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 a new list will be created in the SharePoint site you specified and all data from the source will be added to the list.
Peter Kalmström, CEO and Systems Designer of kalmstrom.com Business Solutions, shows the process in the demos below. Peter uses data from an Excel lists, but you of course add data from any table to the PnP List Generator, even data from a SharePoint list that you are not satisfied with.

The first demo shows the PnP Generator as it looks now, and Peter uses PowerShell version 7. The second 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.

PowerShell V7:



PowerShell V5:


Peter has a Title column in his Excel file. If you don't have that you can rename the Title field in the PnP Generator to something that fits the first column in your source. Then the copy and paste will be quick and give a good result.

Learn more






Products Buy FAQ Services Tips Books Contact About Us Tools

Security and integrity

Copyright  Kalmstrom Enterprises AB  All rights reserved