Nagarajan Elumalai

Nagarajan Elumalai

  • 1.8k
  • 174
  • 12.1k

SharePoint Multiselect Choice field Saving using PnPjs

Aug 13 2019 12:08 AM
Hi
 
I want to save multiselect dropdown in sharepoint field. I already referred few results in this site.
Choice values in SharePoint : Test1,Test2,Test3,Test4,Test5.
 
From the custom dropdown choice field user will select multiple values i want to save the data in multiselect choice field in sharepoint list.
 
Now am getting results as
 
var testvalue="'Test1','Test2'";
$pnp.sp.web.lists.getByTitle("TestList").items.add({
Testchoicefield:{results:[testvalue]},
LastModifiedByDisplayName:_DisplayUserName,
LastModifiedByUserId:_CurrentUserID,
LastModifiedOn:_modifiedon
}).then(function(resultdata) {
idvalue = resultdata.data.Id;
ShowMsgaddupdate("Data Saved Successfully", "", "Ok");
 
But am not able to save the item. Its throwing error. could you please help me.

Answers (2)