|
|
|
Importing a file into a table within my database (via CSV) Last Updated 9/22/2009 |
|
When setting up or updating content within your Volusion store, you may be required to update a large number of records in your online store's database. For example, you may need to update the prices on half of your product inventory. If your online store is configured with only a handful of products, performing this task within your Volusion Admin Page is relatively simple. However, if your store is equipped with hundreds or thousands of products, this can be a very time consuming task. Fortunately, your Volusion store allows you to import data into its database system using a simple text file known as a CSV file (Comma Separated Value). This can save you a great deal of time when updating a large number of records in your store's database. This article will demonstrate how you can import data into your online store using a CSV file. Volusion's Import / Export Tools:
Once you've logged into your Volusion store's Admin Page, you can find your store's import and export feature by clicking on the Inventory tab in your store and clicking the Import / Export link in the main menu bar. Here, you can click on the Data Import or Data Export links to view your store's import or export settings and controls. Creating a Template for Importing:Before importing data into your Volusion store, it is highly recommended that you generate a CSV file template that you can update and then import back into your store. This will allow you the ability to edit a CSV file that contains the correct column names and structure for the portion of your Volusion store's database you wish to update. For example, the following details how you can export a CSV file to use as a template to update your Volusion store's product database table:
Note that if your store contains a large number of products that the export process could take a few minutes. Once this process has completed, you can click on the available link to download your CSV file. Editing the CSV File:Once you have created your CSV file export, you can use this file to update any product within your store, save the file and then import it back into your Volusion store to post those changes to your Volusion store's database.
CSV files can be edited in any standard spreadsheet program such as Microsoft Excel or Open Office. Be sure when finished editing your CSV file to save it as a CSV-format file within your program's file menu.
Importing the CSV File:With your CSV file edited and saved, you're ready to import it into your Volusion store. You can do this by following these steps:
You will receive a notification once your import is complete. Note that of the 3 import mode options, it is recommended to refrain from using the Clear table option as this will remove all pre-existing table information during the import. This option should only be used if you wish to completely clear a table and repopulate it from scratch using a CSV file. Common Import Problems:When performing an import to your Volusion store, you may encounter some errors. The following will detail some tips you can use to avoid these errors: Avoid Columns Without DataSome spreadsheet editors can reformat cells within columns that have no data contained within in them and insert non-breaking space characters. This can cause errors when attempting to import data into your store.
To avoid this, simply highlight any column within your CSV file that is assigned a column name but does not contain any data, right click the highlighted column and select delete.
Check Your Data Types:Each field in your Volusion store is assigned a data type. This refers to the kind of data that can be contained within each element in the store database (e.g. text, integers, dates, etc.). You must adhere to these data types when editing your database tables in a CSV file. For example, the ProductCode column within the products database table is of a TEXT data type that can contain up to 30 characters. If a this field were imported into the Volusion store with a value greater than 30 characters, this will cause an error and the import process will not be performed. Note that you can view the data types of any element in your store's database when selecting columns during your store's export process. Notice for Macintosh Users:When editing a CSV file in Microsoft Excel for Apple Macintosh computer, some versions of Excel for Mac feature multiple types of CSV files you can save to. If presented with multiple CSV types in the Excel file menu, be sure to select "CSV file for Microsoft Windows" as the CSV format to save to. Special Characters:
Certain characters contained within CSV file cells can cause issues, preventing the file from being imported. For example, Excel may convert cells with data containing long strings of numbers such as Category IDs. For example, if within your CategoryID column for a product you list multiple categories such as: 14,25,35,69,71,73 Excel will convert that cell to read as 142535697173, removing the commas. Because of this, your file will fail on import because the Category ID does not match your system. It is recommended to remove any double quotation marks from any value to be imported into your Volsuion store. In a case where quotations are required, its recommended to substitute double quotations (") with single quotations (').
Additionally, any fields to be imported into your Volusion store that contain commas should be enclosed with single quotations.
|