1 (edited by MMacct 01/05/2026 12:10:53 am)

Topic: Import CSV Items

I have successfully installed/enabled Import CSV extension, access rights, etc.
However, I have been unsuccessful in regards to importing my CSV file.
I have scoured various and many threads, many have been helpful, but still no joy.
While I have a tech background, I have no knowledge of SQL.

The present "header" I am using with my file is as follows:
ITEM;ITEMCODE;STOCK_ID;Description;Category;units;;MB_FLAG;Currency;Price;

I am sorry if this has been addressed elsewhere, but I have tried but not found a solution.
Any assistance would be appreciated.

Re: Import CSV Items

I have created an example item in FA and attempted to export CSV file of items, but exported file is anything but CSV.
I would love to use this accounting package but the without functional import / export I will need to find another solution.
sad and sad

Re: Import CSV Items

I think I've used the import plugin with items before and it worked. There are 2 import plugins if I remember one just for items? I'll look into it.

On a side note if you want to use myphpadmin (web based SQL tool) it has various output and input including csv and is fairly easy.

Re: Import CSV Items

My education lacks any SQL training, so I have been trying to avoid it.

Based on previous learning experience, importing CSV files should be a simple matter of determining the appropriate format, formatting data and importing. No fuss, no muss.

This has not been the case with FA. Not certain why it needs be so complicated.

5 (edited by trafficpest Today 02:44:43 pm)

Re: Import CSV Items

I’ve taken a look at the source code for import_items located here https://github.com/apmuthu/FA24extensions/blob/master/Extensions/import_items/import_items.php. I can see exactly why your import is failing. This specific script is very rigid about how it expects data to be structured.
Here is the breakdown of the issues and how to fix them.

Note: there could be a variation if you are using a different version of the plugin!

1. The Header and Delimiter Mismatch
You mentioned your header looks like this:
ITEM;ITEMCODE;STOCK_ID;Description;Category;units;;MB_FLAG;Currency;Price;
The key code in the file is this

list($type, $code, $id, $description, $category, $units, $qty, $mb_flag, $currency, $price) = $data;

The Issues:
The Separator: You are using semicolons ( ; ), but the PHP code defaults to a comma ( , ).
The Column Count: Your header has 11 potential slots (counting the double semicolon), but the script uses list() to assign exactly 10 variables.
The Script's Internal Map: In the code, the variables are assigned in this specific order:
type (Must be "ITEM")
code (Item Code)
id (Stock ID)
description
category
units (e.g., 'each')
qty (The script uses this column for Dimensions)
mb_flag (B, M, D, or A)
currency
price

2. The Correct CSV Structure
To get "joy" from this import, your CSV file must follow the logic in line 169 of the code. Do not use semicolons unless you manually change the "Field separator" box in the FA interface to a semicolon before hitting import.
Recommended Header (Standard Comma Separated):
TYPE,ITEM_CODE,STOCK_ID,DESCRIPTION,CATEGORY,UNITS,DIMENSION,MB_FLAG,CURRENCY,PRICE
(Note the script skips the first line so header isn't important for import)
Example Data Row:
ITEM,101,101,Widget Pro,Components,each,,B,USD,15.00
Note on MB_FLAG:
B: Bought (Purchased items)
M: Manufactured (Produced in-house)
D: Service (No stock tracking)

3. Why Export "Is anything but CSV"
The code handles exports in a very "raw" way (Lines 112–134). It tries to force a download by echoing strings directly.
If the export looks like gibberish or a messy webpage, it’s usually because the server is appending HTML or notices to the file. When you export, ensure your browser isn't blocking the download and try opening the file in a plain text editor (like Notepad++ or TextEdit) rather than Excel first to see the raw structure.

Troubleshooting Checklist
Column 7 (The "Dummy" or Dimension): In your header, you had two semicolons together (;;). The script interprets that empty slot as the Dimension. If you don't use dimensions, leave it empty but keep the comma there.
Category Name: The CATEGORY in your CSV must match the "Description" of a category already in FA, or the script will try to create a new one using the default GL accounts you selected on the import screen.
Case Sensitivity: The script runs strtoupper($type). Ensure your first column always says ITEM in all caps.

I know you stated you didn't want to use SQL and that is why I mentioned phpmysql it has a graphical user interface to access the database tables like any spreadsheet editor and supports importing and exporting tables of various formats including CSV. It is a very useful tool since you can import and export from any SQL table not just one specific table through a script and do not have to import any SQL statement to do so.

One final note remember that the data must be compatable format that front and the db expects

Example
stock_id varchar(20) Primary Key. This is the unique identifier (e.g., "WIDGET-01"). No spaces are best. Max 20 characters
category_id int Foreign Key. Note that the CSV script asks for a Name, but the table stores an ID. The script does the lookup for you. But it must exist
mb_flag char(1) 1 character: B (Bought), M (Manufactured), D (Service/Dummy), or A (Assembly).
units varchar(20) 20 character max again and Must match an entry in the item_units table (e.g., "each", "hr", "box")..

Re: Import CSV Items

Thank you for your thoughtful and detailed response.
I will study this and get back to you about my results.

I will also investigate your suggestion about myphpadmin

Re: Import CSV Items

Trafficpest, than you for the time you have invested troubleshooting my issue.

Unfortunately, I am still not experiencing any joy, though I have experienced different results.

Givens:
version: FrontAccounting 2.4.19
extension: Inventory Items CSV Import    2.4.0-3
phpMyAdmin: 5.2.2

1. Using Inventory Items CSV Import module
I have had no further success copying and pasting your Example Data Row.
Exporting I continue to get HTML-like code and can find little of use even when opening in Notepad first.

2. phpMyAdmin
I have managed to export from "0_item_codes" as CSV which makes some sense, but doesn't match the formatting of your example. I have modified and used this to import (1) item into the SQL database, but it never shows up in the GUI for FA > Items.

While I have some programming experience (though quite out-of-date) and I don't consider myself IT naive,
I am trying to run a manufacturing business and have little time to spend this kind of technical troubleshooting trying to set up an accounting package.

I might be open to making one more attempt, but I am ready to move on.

Again, thank you for your time and effort.

Re: Import CSV Items

Yes, the plugin is different than the table. The key is to make one record in the app. Look at the items table in phpMyAdmin to see how it looks, also, take note of the table structure so your data matches the limits, like 20 characters or less for a field.

Then, export the CSV and fill it with your data. After that, you can save the table backup in SQL if desired (take note of what record number was last entered), and import your CSV; then, your items should be in the table. I think you don't put a header in phpMyAdmin, just data in your CSV. If you make any mistake, just delete the records and import again.

Once you get the hang of it it is pretty easy and you can use it for any sql app or operations.

Re: Import CSV Items

The drag is just the bulk importing once you have it setup it will be regular use and front will give you accounting plus inventory for free compared to QuickBooks for 40 USD plus inventory 60 USD a month. There are some others as well I don't know if they have inventory

Re: Import CSV Items

Thank you for your response.

I am looking for a more affordable alternative to QB.
However, I have already invested more time than I have available in FA.

Maybe later, but right now, I have to focus on my own biz rather than invest in diagnostics.