Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Display Submission Data on User Page

KK
KK
Vote:
 

Hello everyone,

I would like to display the form submission records on User's Page. Could someone advice how to fetch the data?

I see the submission datagrid from Editor view, now I wanted to show that data to end users. 

And also is it possible to modify it from User Page?

Thanks in advance.  

#285402
Aug 12, 2022 4:39
Vote:
 

You can, in theory, use IFormDataRepository to load submissions. Could be a bit tricky though 

#285406
Aug 12, 2022 8:55
KK
Vote:
 

Thanks so much, Quan.

Could you elaborate a bit more about IFormDataRepository? Can I directly DI its instance into my block component?

And do we have any documents or articles for getting some details?

#285413
Aug 12, 2022 10:33
Vote:
 

This came up before here: https://world.optimizely.com/forum/developer-forum/CMS/Thread-Container/2017/5/programetically-getting-episerver--forms--submitted-data/

Sample code from Dejan there:

List<Submission> submittedData = _formDataRepository.GetSubmissionData(
    new FormIdentity(formGuid, languageBranch),
    DateTime.Now.AddDays(-100),
    DateTime.Now).ToList();
#285452
Aug 12, 2022 17:58
KK - Aug 15, 2022 2:07
Thanks so much, Daniel.
Vote:
 

It is tricky because there is no method to load form(s) submitted by a specific user. You can, in theory, use DDS directly to get those data, but it'll be non trivial

#285490
Aug 13, 2022 7:34
KK - Aug 15, 2022 2:09
Thanks Quan. That was exactly what I needed. Load the all of the form data by a specific user. Could you tell more of DDS?
* 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.