Lost password?    Lost username?    Create an account
OverviewDownloadsForumSupport
CSV Improved

CSV Improved

The use and non-use of ID fields

The use of ID fields in import files often gives many users problems, whether this is due to not reading the documentation or expecting different behaviour from CSV Improved is not the question I want to answer here. What I do want to hightlight is the problems that might occur using ID fields.

What is an ID field?

An ID field is a field that holds a unique reference number for data in the database. Examples of ID fields are:

  • product_id: Holds the ID for a product
  • manufacturer_id: Holds the ID for a manufacturer
  • category_id: Holds the ID for a category
  • etc.
In the Available Fields list, these are all the fields that end with _id.

What is the life expectancy of an ID field?

The life expectancy of an ID field can range from days to years. As long as the data does not get deleted from the database the ID stays the same. Regularly deleting and importing new data makes the ID change as often as this process is repeated.

How important is the ID field?

As mentioned earlier, the ID field is unique. This makes it important however not as important as other fields that are more consistent than the ID field. Some examples of more important fields:

  • product_sku: The Stock Keeping Unit will almost never change as it identifies a specific product
  • manufacturer_name: The name of a manufacturer is also unlikely to change
  • category_path: The name of a category is unlikely to change

Even though the ID field is important to the shop, other fields are more important for import.

Which field should I use?

It is advised not to use ID fields for import. CSV Improved will find the correct ID based on the other fields you import. If an ID is ever changed and you don't know about it, the import will go wrong.

Another example is when you are importing new data, the ID field does not exist and nothing will be imported as the database cannot find the ID and your shop will remain empty.

Final words

Be cautious using ID fields in your import file, imports are more likely to succeed not using these fields.

TESTIMONIAL

Excellent!
5 stars
2013-10-10
I'm really happy with this extension. It does what it's supposed to do.

I experienced an easy and clean install and it was fairly easy to learn how to use the extension.

I was able to make an export of Seblod 2 data with it (unfortunately Seblod 2 doesn't have an export feature). Even more so, I was able to add a frontend menu to do a one-click export of my data. Great!

I really like the Replacements feature, which lets you replace the data of your fields with some more user-friendly data. Oh, I really wish the multiple replacements feature wasn't only available in the Pro version :)

My only complaint is that the component probably needs better documentation. A good "Getting started" video would come a long way.

Once again - excellent! Thanks!

STAY INFORMED


Stay informed with the CSVI newsletter.