+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Sitefinity 5.1 Form Responses

Sitefinity 5.1 Form Responses

5 posts, 0 answered
  1. Jonathan
    Jonathan avatar
    1 posts
    Registered:
    02 Aug 2012
    02 Aug 2012
    Link to this post
    Is there any way to list the form responses to the front end of the website? It would be nice for certain users to be able to view the responses without having to log in to Sitefinity.
  2. BoaMike
    BoaMike avatar
    51 posts
    Registered:
    25 Sep 2009
    02 Oct 2012
    Link to this post
    I was wondering the same thing, The Poll Widget in the Marketplace has some good code for getting started.  I haven't done much work on it yet, but the basics of accessing multiple choice form responses via the Fluent API seem to be there.  
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    02 Oct 2012
    Link to this post
    No, there's nothing without custom code...even export requires custom code :/
  4. Gérald
    Gérald avatar
    1 posts
    Registered:
    19 Mar 2013
    30 Jan 2014
    Link to this post
    Hello guys,
    Is there any update on this. I am trying to accomplish that. Has anyone done it ?
    Thanks,
    Gérald
  5. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    Registered:
    21 Jan 2015
    04 Feb 2014
    Link to this post
    Hello Gérald,

    You can achieve this using the API. You can get a form of your choice, get the form entries and for each entry to call GetValue extension method to obtain the custom field value:
    using Telerik.Sitefinity;
    using System.Linq;
    using Telerik.Sitefinity.Modules.Forms;
    using Telerik.Sitefinity.Forms.Model;
    using Telerik.Sitefinity.Model;
    using System;
     
     
    namespace SitefinityWebApp
    {
        public partial class GetFormResponses : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                FormsManager formsManager = FormsManager.GetManager();
     
                // Get the form named "Some form title"
                var forms = formsManager.GetForms().Where(f => f.Title == "Some form title");
     
                foreach (var form in forms)
                {
                    var records = formsManager.GetFormEntries(form);
     
                    // Loop through all the response records for this form
                    foreach (var record in records)
                    {
                        FormEntry fe = (FormEntry)record;
                        var test = fe.GetValue("some value name");
                    }
                }
            }
        }
    }

    After getting all the data, you can bind it to a gridview for a perspicuous overview.

    Regards,
    Vassil Vassilev
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
5 posts, 0 answered