Forums

Saving form data to database in CF8

verdantgrowth 12 Apr, 2024
I have recently started using CF8 and am trying to figure out how to save form data into the site's database. 

I am most familiar with CF6/7 where you select the form, click "Create Table", and then set that table in the "Save Data" action.

I see it is a bit different in CF8. I have "Log Data" set to "Yes", and I have the "_chronoforms8_datalog" table selected in my form's "Save Data" action (see attached screenshot) -- however data is not being saved.

Do I need to define the "Data Source" and add any behaviors? For sake of argument, assume my form includes three fields: "name", "email", and "message".
ChronoForms-8-Kensington-PAZ-Administration copy.jpg
Max_admin 12 Apr, 2024
Answer
You should not use a "Save data" for that, Save data is for saving to a private table of your choice which you may already have or create using PHPmyadmin or our ChronoMyAdmin extension for Joomla

For viewing the form logs, check this tutorial:

How to save and view the form data in Chronoforms8 - ChronoForms8 - FAQs (chronoengine.com)
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
verdantgrowth 16 Apr, 2024
Max,

That is what I originally did (i.e. no "Save Data" action); I simply set "Save Data" to "Yes" in the form settings. But no form data is being saved upon submission. See the attached screenshots.
Form settings.jpg
Form actions.jpg
Form data log.jpg
Max_admin 16 Apr, 2024
the redirect is happening before the data is logged, you can solve this with a delayed redirect:

How to delay the redirect in your form - ChronoForms8
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
verdantgrowth 17 Apr, 2024
Max,

That worked -- thanks!

Btw... I've never had to add a redirect delay to any other forms I've created using CF7/8.  Is there any particular scenario in which that is normally required?
Max_admin 18 Apr, 2024
normally it's used when you want to show a message before the redirect or wait for something to finish, as the redirect will terminate anything after it and any screen output
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.