Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
2 like 0 dislike
2.1k views
in SharePoint Server by 1 1 2
edited by

How to import excel data into a SharePoint list using Rest API in SharePoint Online, and sharepoint server.


1 Answer

0 like 0 dislike
by 163 204 403
edited by

Is it possible to Import Excel data to a SharePoint List Using RESt API?

Unfrothantly, There is NO REST API endpoint to import excel data to a SharePoint list.


Workarounds

The available workarounds are:

  • Using the OOTB import spreadsheets in SharePoint.
  • Using PowerShell to add items from the excel sheet in SharePoint List.

1) Using the OOTB import spreadsheets in SharePoint.

  • Open your SharePoint Site.
  • Click on the Setting icon > Add a new APP.
  • Search for Import Spreadsheets.

import spreadsheets in SharePoint

Read more about SharePoint Import Spreadsheets considerations at Import Excel Sheet Into Project Server

2) Using PowerShell to add items from the excel sheet in SharePoint List.

Install-Module SharePointPnPPowerShellOnline
$Listitems = Import-CSV "C:\listItems.csv" 
foreach($item in $Listitems){
    $List = @{}
    $item.psobject.properties | ForEach-Object { $List[$_.Name] = $_.Value }
    $suppress = Add-PnPListItem -List "SharePoint List"  -Values $List 
}
If you don’t ask, the answer is always NO!
...