Excel import and export of articles
You can export your articles to an Excel file and import articles from one, in the console, without writing code. Open Articles and choose Export to Excel or Import from Excel.
An import adds and updates articles. It never removes anything. To load articles from your own systems instead, see Loading data.
The file
The file is an Excel workbook (.xlsx). The console reads the first sheet. Row 1 contains the column headings, and each row below it is one article.
| Column | Contains | In an import |
|---|---|---|
sku | The article's SKU | Required. Identifies the article. |
name | The article's name | Optional. |
type | article or bundle | Optional. It is checked, never changed; see Bundles. |
meta.<key> | The values of one metadata key, for example meta.category | Optional. Any number of columns. |
Several values of the same key share a cell, separated by |: shoes|sale. Spaces around a heading and around a value are removed.
Download an example file that you can import as it is.
Export
An export contains every article that is not deleted, sorted by SKU, with one column for each metadata key that any article uses. The metadata columns are in alphabetical order.
- Every cell is a text cell, so a SKU such as
00123keeps its leading zeros and a value such as=1+1is not calculated as a formula. - A bundle is a row with
typebundle. Its components are not in the file. - A VAT class that an article has in a tax area is not in the file.
- Excel holds 16,384 columns. If your articles use more than 16,381 metadata keys, the export contains the first 16,381 in alphabetical order, and the console states how many keys it left out.
- A metadata value that itself contains
|is exported as it is. An import reads it as several values, and the console states how many such values the export contains.
Import
An import is a patch: it adds or updates what the file contains and leaves everything else.
- A SKU that does not exist is created. A SKU that exists is updated.
- A filled cell replaces that value. For a metadata key, the values in the cell replace all of the key's earlier values.
- An empty cell, or a column that is not in the file, leaves that value unchanged. This applies to the name and to metadata.
- Metadata keys that are not in the file remain on the article.
- Articles that are not in the file are not changed.
- Nothing is removed: no article, no name and no metadata value.
- The VAT class that an article has in a tax area is not changed.
To change one metadata key on many articles, import a file with only the sku column and that key's column.
A row that changes nothing is not written, so importing an exported file without editing it writes nothing and adds nothing to the change log. Each article that the import changes gets a new version, with you as the user who changed it.
Bundles
You can update the name and metadata of an existing bundle. Its components remain. You cannot create a bundle from Excel, and an import cannot change an article into a bundle or a bundle into an article: a row whose type differs from the article's type is an error.
Deleted articles
A row with the SKU of a deleted article creates the article again, with only what the row contains. The prices that the article had before it was deleted do not come back; send them again. The summary shows the number of articles that are created again.
Cell types
A text cell is imported as its text. A number cell is imported as its number, without added decimals: 123, not 123.0. A formula is imported as its result.
A cell that contains a date, TRUE or FALSE, or a formula error is an error, because Excel displays such a cell differently from what it stores. Format the cell as Text and type the value again. A formula whose result is not saved in the file is also an error; some programs other than Excel save formulas this way. Open the file in Excel and save it again.
Check before anything is written
The console checks the whole file before it writes anything. It then shows a summary: the number of new, changed and unchanged articles, and the number of deleted articles that are created again. Nothing is written until you confirm.
If the file contains an error, nothing is written. Each error is listed with its row in Excel, its column and the reason. The following are errors:
- The file is not a valid
.xlsxworkbook, or the first sheet has no rows below the headings. - The
skucolumn is missing, or two columns have the same heading. - A heading is not
sku,name,typeormeta.<key>. A heading such asmeta categoryorvat_classis named in the error, so a misspelt heading is never ignored. - A row has no SKU, or two rows have the same SKU.
- A cell contains a date,
TRUEorFALSE, or a formula error. - A row would create a bundle or change an article's type.
- The import would create more articles than your plan allows. If the console cannot read your plan's limit with your sign-in, the summary states this, and an import that passes the limit stops part-way; the result shows what was written.
A metadata key that a price rule's filter cannot name, such as a key that contains a space, gives a warning in the summary. The import still writes it.
After the import, the console shows how many articles were written. If an individual article is rejected when it is written, it is listed with its SKU and the reason, and the other articles are still written.
Limits
- The console reads and writes the file in your browser. An import of 10,000 rows takes less than a minute; keep the tab open until it finishes.
- A large import is sent in several requests. Each article counts as one unit against your ingest rate limit, and the console waits and continues when the limit is reached.
- If someone else changes an article between the check and the write, the import's version of that article applies. The earlier version remains in the article's history.
Not included
- An import that removes articles or values that are not in the file.
- Deleting articles from an Excel file.
- VAT classes of articles; see Loading data.
- Prices and pricelists.
- Creating bundles or changing their components.