How do i import CSV data?

I am having same issue, there is no option to select a csv file to import

https://wiki.invoiceplane.com/en/1.6/system/importing-data

Thank you. I have followed the guidance, naming the file as needed and ensuring each column is named exactly as stated. I can now see the option to select the file, however, when I do an import, no data is imported.

Most likely probably there are some errors in the log file in application/logs

If there is a way you can screenshot thr contents of this folder:

uploads/import

That would be great

The following is the error thrown

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

ERROR - 2025-06-10 21:03:54 → Severity: Warning → foreach() argument must be of type array|object, bool given C:\xampp\htdocs\invoiceplane\application\modules\import\models\Mdl_import.php 388

1 Like

Which version of InvoicePlane are you using?

The latest version v1.6.2

The problem is that InvoicePlane is trying to process all the records from your import, but it can’t.

Can you show screenshot of your uploads directory?
I believe it’s here:
C:\xampp\htdocs\invoiceplane\uploads

Sure, here it is.

1 Like

Ok, next screenshot:
C:\xampp\htdocs\invoiceplane\uploads\import

Here you go,

Interesting! Sk all you try to do is import clients.csv

Somewhere in the process it reads "all files in uploads/import
and somewhere during or right after that reading of "all files in uploads/import it gives back an “integer” instead of an “array”

Then we go to that function from the error message, import_details, (something like that):

for each of all these id's i've just read in this csv file, import them into the database

InvoicePlane returns the error:

dear user, those id's is 1 single number, it's not a bunch of id's

conclusion:

Somewhere in the process where a bunch of id’s was supposed to be returned, just a simple number (that integer) was returned.
after that, the processs doesn’t understand what to do with that single number, that integer, and errors.
and it logs it very nicely in application/logs

I resolved this. After everything was discussed, the only thing I could think of was that the column header for ‘client_active’ was named as described in the importing guide, as ‘client_active (1 for active, 0 for inactive)’, which is what I had labeled it as. This error was identified when I reviewed the error logs in ‘application/logs’ that pointed to the ‘Mdl_import.php’ file that had the header listed as ‘client_active’. Once that was changed the import was successful.

Thanks for your help!

1 Like

If you want you can make a pull_request for the documentation here: Wiki/wiki/en/1_6/system/importing_data.blade.php at master ¡ InvoicePlane/Wiki ¡ GitHub

  • fork repository to your own personal github account
  • clone your own personal github repository
  • git checkout -b improve-import-documentation
  • change that documentation file
  • `git add (that documentation file)
  • git commit -m improve unclearly written instructions about the import header of the clients csv file`
  • git push -u origin improve-import-documentation

That pushes your improvements to your own personal github account

  • visit your own personal github account

  • In your forked repository it will tell you that you have 1 commit for the main InvoicePlane documentation (wiki repository) and it will give you an opportunity to create a pull_request (green button)

  • As soon as you press that it will prepare a pull_request, - As soon as you press “create pull_request” a new pull_request will be created for the Wiki (documentation site)
    It seems a lot of steps, but thats only because it’s fully written out.

  • fork

  • clone locally

  • create branch

  • add file and commit

  • push

  • create pull_request

(6 steps, not that bad)