How to import categories
Learn how to import categories from beginning to end
Last updated
Learn how to import categories from beginning to end
Last updated
A prerequisite to importing categories is having an excel spreadsheet with the data organized in named columns. For this tutorial we have a made a simple spreadsheet containing information about a clothing category tree.
In addition, if you want to import a tree structure, you need to give the system a way of identifying parent categories when importing. One way of doing this is adding an identifier to the catalogue you are importing the category tree under.
In this example we have created an identifier called 'ClothingCategoryId' with pattern '{0}' using the property 'CategoryAlias'. In short this means the identifier will have the same value as 'CategoryAlias'.
Read more about creating identifiers on catalogues here: Identifier details
To start importing you choose the excel spreadsheet with the data you want to import, in this tutorial the spreadsheet is called "CategoryImportFile.xlsx".
Next you need to choose the correct Import type. When importing categories, products, variants, variant groups or global lists the 'General Excel Import' type is used.
While it is possible to include media assets when importing, this will not be covered in this guide. For this reason we leave 'Include media' unticked and 'Select media folder' empty.
Having chosen the correct file and import type you can click the "Upload"-button to start the import.
Having clicked the "Upload"-button you are presented with a new page. This is where you will map your excel columns to data fields on categories.
As we are importing categories we choose 'Categories' in the Entity type dropdown.
Next is mapping the actual data. In this tutorial we map our 'Reference' column to 'Category Alias' as this is the attribute we are using as identifier that will identify which categories are parents of which child categories. This is also used as key as it uniquely identifies the category.
The 'Name' column is mapped to 'Name (en-GB)', this is the attribute we use as Display name for the category.
We leave 'Product reference' empty, as this attribute will be used to map child categories to their parents and is not an attribute that exists on the categories.
If no categories with the key exists, new categories will be created for each unique key you are trying to import. If the excel spreadsheet contains new categories you will be prompted to map their parent-child relations and choose the catalogue to create them under.
We are keeping the reference to the parent in the column 'Parent reference' and want to map it to the unique identifier 'ClothingCategoryId' that exists on the catalogue 'Product'.
Click the "Next"-button in the right-bottom corner to continue.
At this point you are shown a 'Review changes'-page. This page will show you the amount of new and updated categories. New categories will be denoted by having a blue 'New'-tag in the key column whereas existing categories will show their current value.
Attributes that will be changed are colored green to easily distinguish between attributes that will remain the same and attribute that will change.
In this tutorial we are importing all new categories, so everything is shown as green.
Having reviewed the changes you can choose to approve the changes you are satisfied with. Only approved records will be commited.
When you have approved the records you want to keep, click the "Commit import"-button in the bottom-right corner to finalize the import.
You can not approve a child category without approving its parent. Doing this will cause the import to fail as it cannot correctly identify where to put the child.
The import from this tutorial will result in the following category tree under the catalogue 'Product'.