Sitefinity 5.1 Form Responses

Posted by Community Admin on 03-Aug-2018 18:28

Sitefinity 5.1 Form Responses

All Replies

Posted by Community Admin on 02-Aug-2012 00:00

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.

Posted by Community Admin on 02-Oct-2012 00:00

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.  

Posted by Community Admin on 02-Oct-2012 00:00

No, there's nothing without custom code...even export requires custom code :/

Posted by Community Admin on 30-Jan-2014 00:00

Hello guys,
Is there any update on this. I am trying to accomplish that. Has anyone done it ?
Thanks,
Gérald

Posted by Community Admin on 04-Feb-2014 00:00

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

This thread is closed