Script to add Multipile items at a time to SHarePoint list

sns 9,231 Reputation points

I want to add multiple values at a time to list columns , please help me with script. PFA, I got excel sheet as per attached.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,276 questions
0 comments No comments
{count} votes

Accepted answer
  1. JoyZ 18,056 Reputation points

    @sns ,

    Create a csv file as shown below:


    Then run following pnp powershell to upload items from csv file to SharePoint list:

    $SiteUrl = ""  
    $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.

0 additional answers

Sort by: Most helpful