Saving data in V6 for general and repeatable data

Save general and repeatable form data to a database in ChronoForms V6.

Overview

The issue arises when needing to store both general form data and data from a repeater area into a database, with one record per person including all information.
Use a Loop Event action with a Save Data action inside it. Set the Loop Event's Data Provider to the repeater dataset, and use Data Override on Insert to include the general form fields in each person's record. Alternatively, in CF v6.1, enable the new Log Data setting for a quicker solution.

Answered
ChronoForms v6
CK CKEtest 11 Mar, 2019
Hi

We have a form where up to 6 people can register to an event. The form contains a general part like organisation name, address etc. and a repeatable part, like name, surname etc. for each person to register. The repeatable part has been implemented as repeater area.

We would ike to store the form data into a database, one record per person containing all data, the general and individual/repeatable ones. We are struggling with the implementation.

How to insert both parts, general and individual/repeatable in a save data event ?
Max_admin Max_admin 11 Mar, 2019
Answer
1 Likes
Hello,

So one record for the whole organization record and the persons ? if yes then the demo repeater form included in the installer will do that if you add a "Save data" action to the form.

But if you want to save the persons in another table with one person per record then you need a Loop Event action with a "save data" inside, set the "Data provider" of the Loop Event to the persons repeater data set in the data array, it should be {data:Guest} if you are testing with the demo form!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
CK CKEtest 11 Mar, 2019
Hi Max

Thank you for your support. I added a Loop Event Action with Sava Data inside. In there I disabled the Auto save fields. To have the general data added for each person to the database, I enhanced the fields in the Data override on Insert (e.g. organisation:{data:organisation}).

Best regards
he healyhatman 12 Mar, 2019
Data override on insert would more likely be e.g. databasefieldname:{var:loop_event#.row.formfieldname}
Max_admin Max_admin 06 May, 2019
Hi,

For quick form data saving including the repeater data, use the new "Log data" setting in v6.1

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
CK CKEtest 06 May, 2019
Hi Max

Thank you for letting me know. I will try the new feature in the next form.

Best regards
This topic is locked and no more replies can be posted.