Form doesn´t save all data to database

How to save all form data to the database in ChronoForms.

Overview

The issue occurs when the form data is assigned to a specific model ID for Google Export, but the same model ID is not configured in the Database Save action.
Ensure the model ID in the Database Save action matches the one used for Google Export. For exporting automatic fields like 'id' and 'created' to Google Sheets, use a Custom Code action to copy these values into the Google Export array after the Database Save.

Answered
jo jorgve 27 Nov, 2014
Hi,

Today I´ve installed this component to subtitute Breezingforms, and I have to say that you guys made a great component.

But, I cannot get my form to save all the data to the database!
The automatic created ones: "id", "Uniq_id" and "created" are stored.. But the other dates such as "nombre" "email" "telefono" etc. are not saved, while I´ve configured them in the table.

I´ve also set up a google drive sheet connection, and the missing dates ARE exported to the sheet (well, I´d like to know how to export "id" and "created" also to Google since I cannot give them an Array name, but that´s another story..).

I´ve added all debug information to the post, I hope you can help..

Cheers,
Jorg
Gr GreyHead 27 Nov, 2014
Hi Jorge,

Please re-post the debug output - that got lost somewhere.

Bob
jo jorgve 28 Nov, 2014
Thanks for taking the time looking into it, I´ve added the debug info to this post.
Gr GreyHead 30 Nov, 2014
Hi Jorg,

It looks as if your form data is set under the GSave Model ID for the Google Export but you haven't set the same Model ID in the DB Save so the data isn't being found.

Bob
jo jorgve 02 Dec, 2014
Ok, thanks. When I changed the GSheet [nombre] to just "nombre" it´s saving all data in the DB!

But is there a way to export the "created" "id" and "uniq_id" to the google Spreadsheet as I´m not able to change their Model ID´s to "GSheet[created]"?
Gr GreyHead 02 Dec, 2014
Hi Jorg,

Yes, set the GSheet model ID in the DB Save action.

Bob
jo jorgve 02 Dec, 2014
Thanks a lot for your quick reply, that part is working... The only thing is that I´m using a dynamic dropdown for the provinces (depending on a dropdown of countries), in exactly the same way you´ve used in your demos which came with the component: http://demos.chronoengine.com/index.php/chronoforms/dynamic-dropdown.

Could you maybe explain how can I refer to the Model ID "GSheet[provincia]" in the custom PHP code? Because like that it doesn´t seem to work.
Gr GreyHead 02 Dec, 2014
Answer
1 Likes
Hi Jorg,

I'm not clear what order your actions are in. If you are doing the DB Save first then ChronoForms will add the values you want into the $form->data array and you can then use a Custom Code action to move them into the GSheet sub-array. It will be something like this:
<?php
$form->data['GSheet']['id'] = $form->data['chronoform_data']['id'];
$form->data['GSheet']['uniq_id'] = $form->data['chronoform_data']['uniq_id'];
. . .
?>

Use a Debugger to see exactly where the data you want is currently saved.

Bob
jo jorgve 05 Dec, 2014
It works!! Thanks a lot for your fast replies GreyHead, I really appreciate it, you´ve got a fantastic component and amazing support!
This topic is locked and no more replies can be posted.