How to create a Survey in SharePoint using CSOM?

Hello SharePointers,

Here are the CSOM code to create a survey list in SharePoint 2010/203 or SharePoint Online.

public static void CreateSurveyList()
{

ClientContext ctx = new ClientContext(“http://mysite”);

ListCreationInformation lci = new ListCreationInformation();
lci.Description = “Test Survey”;
lci.Title = “First Survey”;
lci.TemplateType = 102;
List newSurveyList = ctx .Web.Lists.Add(lci);
ctx .Load(newSurveyList);
ctx .ExecuteQuery();

}

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *