Reputation: 10276
I am using UpdateListItems method (Lists.asmx web service) to update fields of an uploaded document in one SharePoint document library. In my case, I have a document library called Schedules. In it, there's a field called 'Day of the Week' which is a Choice multiple selection, with the allowed values Monday to Sunday. Here's the query that I have found which should select Monday and Friday choices (and it doesn't work, obviously):
<Method ID='1' Cmd='Update'>
<Field Name='ID'>1</Field>
<Field Name='Day of the Week'>Monday#;Friday</Field>
</Method>
I have read somewhere that inserting the string "#;" between the choices should resolve this. The end result is that the field Day of the Week is updated with the string "Monday#;Friday" and when I want to edit the item, no selection is being made. On the other hand if I just use "Monday", it works. Now, how can I make it update the multiple selection? Thanks.
Upvotes: 4
Views: 4143
Reputation: 138117
I believe that should be ;#
A quick check shows the way SharePoint stores multi-choice fields, try:
;#Monday;#Friday;#
With the delimiter on the beginning and the end.
And a note: You should also keep in mind that SharePoint stores choices as plain text (not references), so you can place any value there, as you've just witnessed.
Upvotes: 2