SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL
SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL

PowerShell – upload CSV file to List (both Server and Client OM)

Recently I had a friend ask about how to upload a local CSV data file to a SharePoint site.  The scenario is that a daily CSV file is provided on a network share and needs to be imported to SharePoint for viewing, filtering, and sorting.  The easiest way to code this was with Server Side Object Model.  Be sure to compare the source/destination columns and make sure everything lines up OK.   The schema must match for any import to be successful.

This also can be accomplished with Client Side Object Model, it just takes a little more code.   If you don’t have access to the SharePoint server this is a great option with flexibility to host a PowerShell script anywhere (desktop, job server, etc.)

 

2-24-2012 3-32-35 PM
2-24-2012 3-31-46 PM

http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/22/use-powershell-to-manage-lists-views-and-items-in-sharepoint.aspx

 

Server Side Object Model

Client Side Object Model

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲