@sns ,
Create a csv file as shown below:
Then run following pnp powershell to upload items from csv file to SharePoint list:
$SiteUrl = "https://tenant.sharepoint.com/sites/Team1"
$ListName = "Test214"
$CSVPath = "C:\Temp\Test214.csv"
$CSVData = Import-CsV -Path $CSVPath
Connect-PnPOnline $SiteUrl -Interactive
ForEach ($Row in $CSVData)
{
Write-Host "Adding Item $($Row.'Title')"
#Add List Items - Map with Internal Names of the Fields!
Add-PnPListItem -List $ListName -Values @{"Title" = $($Row.'Title');
"Column1" = $($Row.Column1);"Column2"= $($Row.Column2);
};
}
Result for your reference:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@sns ,
Please create a new excel file, fill in the related value, then save the excel file to csv format like this to compare the result:
@sns ,
Have you tried the above solutions?
Would you please provide us with an update on the status of your issue?
Hi Wang,
Sorry for the delated update, it is working after saving the file as u suggested, thank u
Sign in to comment