I have a survey list name called "UserSurvey". I need to fetch the response from UserSuevey list using JSOM or C#.I referred the link
But i need more reference for that .please suggest me an idea to achieve this.
I have a survey list name called "UserSurvey". I need to fetch the response from UserSuevey list using JSOM or C#.I referred the link
But i need more reference for that .please suggest me an idea to achieve this.
Here is my sample code for your reference.
static void Main(string[] args)
{
//make changes based on your site url
string siteurl = "http://sp:12001/";
using (SPSite site = new SPSite(siteurl))
{
using (SPWeb web = site.OpenWeb())
{
SPList Survey = web.Lists.TryGetList("Survey2");
foreach(SPListItem item in Survey.Items){
//Question1 is your survey question, update/add based on your survey list questions.
Console.WriteLine(item["Question1"]);
}
}
}
Console.ReadKey();
}