I tried to create a survey list using JSOM
function listCreation () {
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
var listCreationInfo = new SP.ListCreationInformation();
listCreationInfo.set_title('Test'); // list name
listCreationInfo.set_description('description'); // list description
listCreationInfo.set_templateType(SP.ListTemplateType.Survey); //list type
oWebsite.get_lists().add(listCreationInfo);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded),// when success
Function.createDelegate(this, this.onQueryFailed) // when failed
);
function onQuerySucceeded() {
alert("List Created");
}
function onQueryFailed(sender, args) {
alert("List Failed");
}
}
while executing the function it throws an error msg Uncaught Error: Sys.ArgumentUndefinedException: Value cannot be undefined. in clientContext.executeQueryAsync line. Please help me to solve this issue.
survey
instead ofSurvey