1

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.

1 Answer 1

1

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();
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.