How to set values to a multi choice field using SPServices in SharePoint ?
This Code worked
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "Update",
listName: "Projets",
ID: 53,
valuepairs: [
["ProjectName", "Project"],
["ProjectType", "OPPS"],
["ConcernedServices", JSON.stringify($('#select-multiple-optgroups').val())],
["Cible", "Résidentiel"],
["DateRFF", "2014-12-31"],
["DateLancementPrevisionnelle", "2014-12-31"],
["DateDeFin", "2014-12-31"],
["Priorite", "PA"],
["Concept", "dfsf"],
["Reference", "FDF"],
],
completefunc: function (xData, Status) {
}});
But if I want to add multiple choice doesn't work
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "Update",
webURL: "/sites/ep/",
listName: "Projets",
ID: 53,
valuepairs: [
["ProjectName", "Project"],
["ProjectType", "OPPS"],
["ConcernedServices", JSON.stringify($('#select-multiple-optgroups').val())],
["Cible", "Résidentiel, Business"],
["DateRFF", "2014-12-31"],
["DateLancementPrevisionnelle", "2014-12-31"],
["DateDeFin", "2014-12-31"],
["Priorite", "PA"],
["Concept", "dfsf"],
["Reference", "FDF"],
],
completefunc: function (xData, Status) {
}});
Cible is a Multiple Choice field in a sharepoint List.
Since SPServices is calling the OOB webservices behind the scenes, in theory the standard means of updating multiple choice values should come into play: Delimit the values with ;#
E.g.
";#Résidentiel;#Business;#"
Note: Order matters. Make sure values are specified in the same order they're defined in the column