Sitefinity 5.1 Form Responses
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.
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.
No, there's nothing without custom code...even export requires custom code :/
Hello guys,
Is there any update on this. I am trying to accomplish that. Has anyone done it ?
Thanks,
Gérald
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"
);