Export to csv not functioning
-
The form works great, however, I cannot open the .csv file of the exported submissions. When I open the .csv file in Excel (Unicode UTF-8, comma delimited), I get the following error message: “query didn’t return columns suitable for Microsoft Excel”, and then I end up with an empty Excel sheet.
Hopefully somebody can help me out.
-
Further info: I got the following error message
Warning: Attempt to read property "id" on null in /www/wp-content/plugins/forminator/library/class-export.php on line 136 Warning: Attempt to read property "id" on null in /www/wp-content/plugins/forminator/library/class-export.php on line 139  Warning: Attempt to read property "name" on null in /www/wp-content/plugins/forminator/library/class-export.php on line 151Hi @svanderb
I hope you’re well today!
The error that you are getting seems to be related to CSV file issue as it relates to code that creates this export.
It seems like, for some reason, the code is not getting correct form ID for export which is quite surprising. I checked and I don’t see any bugs in our internal bug tracking system that would be related to this so we’ll need to identify the cause of it first.
For the start, please let us know:
– what’s the PHP version are you using?
– is the WordPress itself and Forminator plugin up to date?
– are there more than one form?
– is the same happening with manual export and scheduled export or just one of them (and if so, which one)?Kind regards
Adam– I’m using PHP 8.1,
– all the plugins are up to date,
– initially I had one form (with lots of conditionals), because the .csv file didn’t work I made a simple contact form. Both have the same problem.
I also had wpforms installed as a plugin and disabled that plugin to see if it made a difference, unfortunately it didn’t.
– the issue is with the manual export. I’ve just scheduled an export to see if that has the same problem, so I’ll know that in about 15 minutes.Hi @svanderb
Could you please take a look at your Forminator > Submission and make sure the “Form” option is selected on dropdown https://monosnap.com/file/IZmpmWYvopKMqOGC1t1eXpOqdteehY
If so, try to re-select it then the correct form and export the submission again.
Let us know if this made any difference.
Best Regards
Patrick FreitasThank you so much! That fixed the problem. Clearly it was just a user fault.
Just one more question (unrelated to this issue).
I would like to use an unique number for payments. In the e-mail notifications I noticed there are values such as {user_id}, but these are not in the .csv file. Is there a way to include this info in the .csv file?
Or is there another way to generate an unique number that I can use in e-mails and is in the csv file too?Hi @svanderb,
It would be ideal to open a new ticket for any new queries, to avoid any miscommunication.
Trying to discuss multiple queries in one single ticket can cause confusion.
The submission ID is only generated after the form submission, so I’m afraid there isn’t an option to add that in the submissions at the moment.
The emails support the {submisions_id} macro as a form data which you could use. Please check the following supported macros in the emails:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#form-dataUnfortunately, the form data is only supported in emails. As a workaround you could try this snippet which programmatically adds an auto-increment within the form:
<?php add_filter( 'forminator_custom_form_submit_field_data', function( $field_data_array, $form_id ){ // We're using a custom macro <code>AUTOINCREMENT_INT</code> set as value for a field. // Make sure you add this value only in hidden fields $needle = 'AUTOINCREMENT_INT'; $incremental = get_post_meta( $form_id, 'autoincrement_int', true ); $update_meta = false; foreach ( $field_data_array as $key => $field_data ) { if ( isset( $field_data[ 'value' ] ) && $needle === $field_data[ 'value' ] ) { if ( ! $incremental ) { $incremental = 1; } else { $incremental++; } $field_data_array[$key][ 'value' ] = $incremental; $update_meta = true; } } if ( $update_meta ) { update_post_meta( $form_id, 'autoincrement_int', $incremental ); } return $field_data_array; }, 20, 2 );Once the code is applied, you’ll need to add a Hidden field with “Default Value” set to “Custom Value” and the Custom Value to AUTOINCREMENT_INT, so that the hidden field will now have to save an incremental number upon each submission.
The code can be implemented as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installaing-wordpress-plugins/#installing-mu-pluginsIf you still have any issues with the above then would highly recommend opening a new ticket and refer the last response from this ticket so that we could assist further if needed.
Kind Regards,
NithinHello @svanderb ,
We haven’t heard from you for a while now, so it looks like you don’t have more questions for us.
Feel free to re-open this ticket if needed.
Kind regards
Kasia
The topic ‘Export to csv not functioning’ is closed to new replies.