Add more fields to Import or Export

Hello All,
In tools->import or export how can I add more fields? for example when exporting products there is no field for minimum selling price. How can I add? Any help would be appreciated.

Look here:

https://wiki.dolibarr.org/index.php/Developer_documentation

Yes, there are many fields missing from the import template, most of which are optional as opposed to manual data entry, and of limited interest to most users.
If you need to add ones that are not included, it is not difficult. The development version dolibarr is much more complete due to additions I made.
This post is a pointer to those changes which highlight the areas where you need to make changes for your requirements:
www.dolibarr.org/t/mass-import-export-8-0-3/17116/4

Hi torvista. This topic has my interest as well. Your link to http://www.dolibarr.org/t/mass-import-export-8-0-3/17116/4 no longer exists.

I would say that this interests me a lot because I have contacts and prospects from other systems outside of dolibarr that I would like to import.

The dolibarr import tool offers quite a bit. Being able to import contacts or prospects with their respective tags and or categories in one single import would be ideal.

However, the dolibarr import tool separates the import of tags/categories from the actual import of contacts and prospects. Under the available import tool options, you would have to first import your contacts or prospects, then go through the import wizard a second time to attach tags/categories to your newly imported contacts or prospects. But then you would have to know the rowid of the contact or prospect and fill out the import template with the rowid and the category/tag. This is a little daunting when your contact and prospect list could be well above 100, 500, or 1000. Not to mention, a single contact or prospect could be attached to several tags or categories.

I’m still digging around to see what I can find to make this import of contacts/prospects or anything else a little easier when you would like to attach tags/categories or any other additional fields to the import.

updated link

I can’t offer further help, I have been sidetracked ever since…maybe getting back into Dolibarr development in the new year!

Yes, it is a little bit frustrating, but after the import you can do an export, so you will have all the third party ID’s. It is some work indeed but doable (for example use MS Excel) .

Here are my thoughts for attaching the respective Tag/category to contacts and prospects:

The import templates provided by the import assistant lists out exactly what a successful import allows. It does not offer any customization to import any additional data. What this means is that we can fill out these import templates with our information and run them through the import assistant. Once we have the contacts and prospects imported, the import wizard provides an import key. With that import key, I can query the relevant database table and export the results as a CSV and condition the data to attach the Tag/category to each result.

The import assistant does have a tool to attach the Tag/category to contacts and prospects. However, it only accepts two value: the rowid of the Tag/Category and the rowid of the contact or prospect. From my 3rd party CSV for contacts, I will be sorting the results by the Last name column in ascending order. From my 3rd party CSV for prospects, I will be sorting the results by the Name column in ascending order. With the database query that I ran earlier by the import key, I will have sorted the contacts by last name in ascending order and prospects by name in ascending order and export the results to CSV. Then I will be cross referencing my database results CSV with the 3rd party CSVs to properly assign the Tag/category values to each row. Once finished, I will be removing every column in my database results CSV except for the rowid column and newly added Tag/category column. At this point, I can use the CSV to perform the import.

As far as “additional fields” and any field that is not part of the contact or prospect import template (example: social media usernames), they would have be done manually in the dolibarr system. The import assistant does not offer a tool to match these “additional fields” or missing fields to their respective contacts or prospects.

Boy oh boy.

It is what it is. Thanks everyone for your input on this.

I was able to accomplish what I needed by altering this scipt from the Wiki to suit my needs.

2 Likes