When i try to retrieve form submission data am unable to retrieve??

Vote:
 

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

#186806
Jan 04, 2018 16:30
Vote:
 

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.

#186823
Jan 05, 2018 5:12
Vote:
 

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

#186824
Edited, Jan 05, 2018 5:36
Vote:
 

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.

#186825
Jan 05, 2018 5:42
Vote:
 

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

#186826
Jan 05, 2018 6:05
Vote:
 

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?

#186827
Jan 05, 2018 7:03
Vote:
 

Sure Dac Thach Nguyen and thanks for your time consideration regard this matter.

Thanks,

Kartheek

#186828
Jan 05, 2018 7:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.