Transfer Sharepoint List Contents to Excel

Bob Wilson 1 Reputation point
2021-09-01T02:56:15.583+00:00

Hello,

So I have certain items on a SharePoint List and I would like to transfer the contents of each item to Excel. I’m not talking about the items that I can see once I click on the list but rather the contents of each list item, because each individual item has contents of its own.

Thank you

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

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,141 Reputation points
    2021-09-01T08:39:25.337+00:00

    Hello @Bob Wilson ,

    Welcome to Q&A Forum!

    Please following steps:

    1.If in the current view not set any filter, in other words you can view all items in the list. You can click on Export >> Export to Excel in the top menu bar

    128264-a1.png

    128237-a2.png

    2.Please run the below powershell script as an admin to export all list items to CSV

    $SiteURL = "https://tenant.sharepoint.com/sites/du"  
    $ListName = "listname"  
    $CSVPath = "C:\temp\ListData.csv"  
    $ListDataCollection= @()  
    
    #Connect to PnP Online  
    Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)  
    $Counter = 0  
    $ListItems = Get-PnPListItem -List $ListName -PageSize 2000  
    
    #Get all items from list  
    $ListItems | ForEach-Object {  
            $ListItem  = Get-PnPProperty -ClientObject $_ -Property FieldValuesAsText  
            $ListRow = New-Object PSObject  
            $Counter++  
            Get-PnPField -List $ListName | ForEach-Object {  
                $ListRow | Add-Member -MemberType NoteProperty -name $_.InternalName -Value $ListItem[$_.InternalName]  
                }  
            Write-Progress -PercentComplete ($Counter / $($ListItems.Count)  * 100) -Activity "Exporting List Items..." -Status  "Exporting Item $Counter of $($ListItems.Count)"  
            $ListDataCollection += $ListRow  
    }  
    #Export the result Array to CSV file  
    $ListDataCollection | Export-CSV $CSVPath -NoTypeInformation  
    

    128265-a3.png

    128208-a4.png

    Thanks,
    Echo Du

    ======================================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.