jasonrollins / shareplum

Pythonic SharePoint
MIT License
179 stars 96 forks source link

Update Multiple Choice field value in list items #139

Open masha6 opened 3 years ago

masha6 commented 3 years ago

I do not manage to update multiple choice field value in list items. Is it possible?

jasonrollins commented 3 years ago

I think it should be. Do a GetListItems on a List that has the multiple choice to determine the correct format for your data.

DavidBreuer commented 3 years ago

Not sure, if this holds for every multiple choice type and Sharepoint version, but this worked for me (assuming choices [OptionA, OptionB, OptionC]:

my_data = {
    'MyNumericColumnName': 3.141,
    'MyMultipleChoiceColumnName': ';#OptionA;#OptionB;#;#OptionC;#'
}
sp_list.UpdateListItems(data=my_data, kind='New')