Which version of Forms are you using? Could you check that the FormGuid, Language.Name is valid? Please try send string.Empty as Language.Name to retrive submission data from all languages.
Hi Dac Thach nguyen
Thanks for your reply,u using in Episerver.forms.core 4.9.0 and i changed the code what you have said but its still retrieve the zero records.
this is my code
submittedData = _formDataRepository.GetSubmissionData(
new FormIdentity(info.FormGuid, string.Empty),
DateTime.Now.AddDays(-100),
DateTime.Now).ToList();
Thanks,
Kartheek
How do you get the FormGuid, it is not your page Guid, it is FormContainerBlock Guid. Could you check that param is correct? If the issue still there, please send us a support case, we will investigate more base on your code.
Hi Dac Thach Nguye,
this is my total code
List<Submission> submittedData;
private Injected<IFormRepository> _formRepository;
FormDataRepository _formDataRepository = new FormDataRepository();
var formsInfo = _formRepository.Service.GetFormsInfo(null);
foreach (var info in formsInfo)
{
submittedData = _formDataRepository.GetSubmissionData(
new FormIdentity(info.FormGuid,currentPage.Language.Name),
DateTime.Now.AddDays(-100),
DateTime.Now).ToList();
}
Thanks,
Kartheek
The variable submittedData in your code ONLY contains last form's submissions. In case your last form does not have any submissions, the result will be empty. I tried your code in Alloy template, debug to see the submissions of each form. It is working, could you pls check again?
Hi Guys,
here i wrote code for retrieve the form data
List submittedData;
submittedData = _formDataRepository.GetSubmissionData(
new FormIdentity(info.FormGuid, currentPage.Language.Name),
DateTime.Now.AddDays(-100),
DateTime.Now).ToList();
i have three records in registration form, the submittedData list retrieve zero records, cany anyone help me out of this.
Thanks,
Kartheek