I have a regular PowerShell script that I use and modify to insert items into SharePoint lists from CSV files. It uses Add-PNPListItem in a foreach loop from the imported CSV and has worked great over time.
I have come across the need to import data into a SharePoint list where the column in list is a Choice field allowing multiple values.
In my CSV, these values are separated by a comma (,) and the values match the options in the Choice field.
When the data is imported I can see them in the view as Blood, Pathology (2 options chosen) but when I edit the item, the column just says please select and the options are not ticked. You need to then re-tick the options before saving because if you don't, it will wipe out the values imported.
My question is how should I approach this? Clearly having the values separated with a comma isn't working. I did make the CSV pipe delimited (|) so it would not see the comma in the CSV as a column separator.
I'm not sure how to get the values recognised by the choice column so they are ticked.
I have attached some screen shots showing what the value looks like in the view and then what happens you edit an item with multiple values.
This does not happen when there is only 1 value in the source.
Thanks - Jon




