Import CSV file into Sharepoint list

Du bist hier:
< Zurück

You can import easily a CSV file in your SharePoint List. If you have a file with special characters like french ones (éàè) you should save your file as CSV UTF-8 format.

You have to first load a module in your PowerShell Session (which you open as admin as usual)

Install-Module SharePointPnPPowerShellOnline

If you connect to your Sharepoint you can test it with (after Connect-PnPOnline)


For the correct field name from sharepoint you have to edit the column and than look in the URL how it is written

In the URL you will find Field= at the end of it and what is written behind is the field name you have to take in the script (Here in the example: Full_x0020_Name)

Now you can execute the full script (see below)


$credentials = Get-Credential -Message "Please Enter SharePoint Online credentials"
$TestData = Import-CSV "C:\scripts\testutf8.csv"
Connect-PnPOnline -Url $Site -Credentials $credentials

foreach ($Record in $TestData){
Add-PnPListItem -List "Name of the list" -Values @{
"Title"= $Record.'Shortcut';
"Full_x0020_Name"= $Record.'Full Name';

The Records are defined with SharePointColumnName = $Record.’ColumnNameInCSVFile’