Title: Export to csv not functioning
Last modified: April 26, 2022

---

# Export to csv not functioning

 *  Resolved [SvanderB](https://wordpress.org/support/users/svanderb/)
 * (@svanderb)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/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.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [SvanderB](https://wordpress.org/support/users/svanderb/)
 * (@svanderb)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15593769)
 * 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 151
       ```
   
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15596729)
 * Hi [@svanderb](https://wordpress.org/support/users/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
 *  Thread Starter [SvanderB](https://wordpress.org/support/users/svanderb/)
 * (@svanderb)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15597388)
 * – 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.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15600957)
 * Hi [@svanderb](https://wordpress.org/support/users/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](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 Freitas
 *  Thread Starter [SvanderB](https://wordpress.org/support/users/svanderb/)
 * (@svanderb)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15601109)
 * Thank 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?
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15602956)
 * Hi [@svanderb](https://wordpress.org/support/users/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-data](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#form-data)
 * Unfortunately, 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-plugins](https://wpmudev.com/docs/using-wordpress/installaing-wordpress-plugins/#installing-mu-plugins)
 * If 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,
    Nithin
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15625109)
 * Hello [@svanderb](https://wordpress.org/support/users/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

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Export to csv not functioning’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [Excel](https://wordpress.org/support/topic-tag/excel/)
 * [export](https://wordpress.org/support/topic-tag/export/)

 * 7 replies
 * 5 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/export-to-csv-not-functioning/#post-15625109)
 * Status: resolved