how to read a csv file and update a sharepoint column with multiple checkboxes


Can someone help please! I am new to Power shell and have to write a script to insert data from an CSV file into sharepoint list.

The data in the csv file can be read easily - no issues. I have update all the SP column that have text from CSV.

The issue is when I try to insert a CSV column value to SP list column where the list is a multi select check-boxes.

(I inherited this project - pls don’t ask me why SP columns were designed this way).

For example in the csv file I have 2 columns that have favorite cities.

city1 city2

row1 Ottawa Toronto

row2 Montreal halifax

In the sharePoint column, I have FavouriteCity column:






How do I insert the value from csv file and force to select the corresponding item in sharepoint ?

I am looping through the csv file

foreach ($row in $dataFile)
$ListItemCreationInformation = New-Object Microsoft.SharePoint.Client.ListItemCreationInformation
$NewListItem = $List.AddItem($ListItemCreationInformation)

$NewListItem[“FavouriteCity”] = $row.(“city1”)


How do I make Ottawa AND Toronto to be selected and saved?


Any guidance / example is greatly appreciated.









You cannot change UI objects without directly inte3racting with that UI object, via an API, or the default object Model. CSOM is what SP uses for the latter. Just do a search for ‘powershell csom sharepoint’ to get resources to review about dealing with that.

Example hits:

CSOM SharePoint PowerShell Reference and Example Codes

See also:

SharePoint: A Complete Guide to Getting and Setting Fields using PowerShell

You say you are new to PS, the it is vital you get ramped up on it first, to decrease the confusion, misconceptions, errors, bad habits, bad code and the like…

See these resources.

And this…

Best Practices

Windows PowerShell

PowerShell Standard Library: Build single module that works across Windows PowerShell and PowerShell Core

Windows PowerShell Best Practices


PowerShell scripting best practices

Powershell - Recommended coding style

What is the recommended coding style for PowerShell?

PowerShell 4.0 Best Practices scripts
This is a place holder for all the scripts from my forthcoming Windows PowerShell 4.0 Best Practices book. Once the book releases, I will upload the 200 scripts to this location – which is currently referenced in my book. The idea is similiar to the one that I did for the Wi