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.
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.