Forums

Some database records have empty values - but they are present in the e-mail that is send

jj135 01 May, 2020
Hi! We have set up a form (online survey) that si send out to groups of people who need to fill out this form. We use a unique code in the URL to identify the group they are in.

The field values are saved in a database table. Also an e-mail is send AFTER the database save is done (on success). Our client now lets us know that she received 20 e-mails with the filled out form data. But fo 8 records in the database are empty (expect aid, user_id and created). So the values are present in all e-mail but not some records in the database? How is that possible?

Any thoughts? How do we debug this?
jj135 01 May, 2020
We did some more research. Our client received 16 e-mail containing all the data from the forms. We cleaned up the database and now see exactly 16 records . But 9 of them have only the uid an creation dated filled out. The rest of the fields are empty. 7 are stored fully.

Also, it does not seem this has happened at some point in time (like 7 OK before one date and then the rest empty after this date) what might indicate something has changed somewhere on the site or server.

This is weird...
jj135 01 May, 2020
The Chronorms 'Save data' action is set to 'Write action' -> 'Auto detect'. Might that cause an issue somehow? Maybe the data is stored twice (withan update) sometimes, but overriding the data with an empty array somehow? Or is this not possible?

We see these options besides the auto detect:

- Insert
- Update
- Insert - duplicate key update
- Insert - duplicate key ignore

Any suggestions on what would be the best choice for us?

Any other thoughts that might help us debug this?
Max_admin 02 May, 2020
What about the Form DB Log, do you have it enabled for this form or not ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jj135 04 May, 2020
Hi! I just checked and I do not see this option... Where can this be found?
I am using CF6. The form is in 'v6 classic mode'
jj135 04 May, 2020
Our database save action:

jj135 04 May, 2020
Sorry about the three identical images ;-)

I can not find any info about the database save options:

- Insert
- Update
- Insert - duplicate key update
- Insert - duplicate key ignore

What do the last two items do exactly and why are they there?
GreyHead 04 May, 2020
Hi jj135,

+ if the submitted data duplicates an existing key update the database record
+ if the submitted data duplicates an existing key ignore the submitted data

Bob
jj135 04 May, 2020
Thanks GreyHead.

So if there is a situation where the data that is sent to the database twice (the second time with empty data) the second option would prevent prevent the initial data to be overwritten?

Not sure if that is happening in our situation. Or when it might be the orther way around (first no data, second time with data somehow )this option would actually prevent the data from being written to the database because the first time the empty values were saved and it will ignore the second one.

Anyway, I know what these option actually do / mean now. Thanks. Nog I still need to figure out why our problems occurs...

We are going to add a 'save to Google Sheets' action as a backup for the local db storage. This does not solve our issue but maybe we can at least figure out if the same thing happens there and if not we have a backup / alternative, It does trouble me that CF might not seem to save data correctly... Or I might be doing something wrong. This is also possible of course ;-)
This topic is locked and no more replies can be posted.