Saving forms to database

jetate

01-05-2019

I currently have some forms set up that are saving to MySQL with the Drafts and Submissions process successfully. For our currently purposes, we are needing to keep these forms available as drafts for users to continually update relating to the progress of varying projects.

However, we are also trying to do some reporting based on the data in these form drafts. Is there a way to simultaneously store the forms data to a separate table in the database that we can run reports from? Or is there another way to store and still be able to modify the data from a different table rather than using the drafts option?

We previously had some database limitations in-house where we were not able to create our own tables, but that was recently resolved. If necessary, we can potentially change how we're currently managing the forms data with the drafts and submissions if we are able to put and pull the data from the database properly, however with close to 2000 active forms, it might be difficult to migrate them all quickly.

Links to tutorials would be helpful as I'm not a master with AEM or Java.

AEM 6.3.3.3

Accepted Solutions (1)

Accepted Solutions (1)

jetate

02-05-2019

Thanks, everyone, for the replies. I figured out how to achieve what we're looking for with the drafts and submissions data in order to create some reporting on our drafts information by parsing the XML in the data field of the data table. That maintains my drafts and still gives me access to my data.

Saving straight from the form was  never my main issue, just trying to maintain my current solution while providing access to reporting.

Answers (9)

Answers (9)

antoniom5495929

01-05-2019

Hi,

You can find in [0] an Adobe official docs which explain how to use the database connection with example of java stuff.

In my experience I started from this in order to achieve our goal.

[0] https://helpx.adobe.com/experience-manager/using/datasourcepool.html

Let us know.

Thanks,

Antonio

jetate

01-05-2019

How would you pull it back out for updating later? Or would it be possible to submit to the database alongside the drafts submission but with just the form data?

smacdonald2008

01-05-2019

You could easily create a custom form action that sends submitted data to an OSGi service. Then you can write Java Database logic to persist the data into a relational database.