# How to use import for classification

## Before importing

A prerequisite when classifying entities using import is having an excel spreadsheet with the data organized in named columns. For this tutorial we have a made three  simple spreadsheets containing jackets that already exist as [products](https://docs.struct.com/fundamental-concepts/data-management), that we want to insert into another [category](https://docs.struct.com/fundamental-concepts/data-model).

<div><figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FR4XAffCjBZzOF6bViOpi%2Fclassify_fullpath.png?alt=media&#x26;token=bb1b5b35-b842-4fa3-ba14-c92967619f68" alt=""><figcaption><p>Spreadsheet to classify using full path</p></figcaption></figure> <figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2F6yBxPvuEqwhgoTDCy41S%2FClassify_id.png?alt=media&#x26;token=fac666dd-c38f-4b3a-b36d-7d587cd81e21" alt=""><figcaption><p>Spreadsheet to classify using id</p></figcaption></figure> <figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2F3DUZVkoHSu2gwBAspAxS%2Fclassify_identifier.png?alt=media&#x26;token=36f09028-4e1e-4569-a500-eb57cc35e597" alt=""><figcaption><p>Spreadsheet to classify using identifier</p></figcaption></figure></div>

In this case we are importing to a [category](https://docs.struct.com/fundamental-concepts/data-model) with full path = 'Clothing > Men > Jackets', id = 186 and identifier = 'Men-Jackets', meaning all of these imports are interchangeable and will classify the [products](https://docs.struct.com/fundamental-concepts/data-management) in the same [category](https://docs.struct.com/fundamental-concepts/data-model).

## Starting the import

To start importing you choose the excel spreadsheet with the data you want to import, in this tutorial the spreadsheet is called "ClothingForImport.xlsx".

Next you need to choose the correct Import type. When importing [categories](https://docs.struct.com/fundamental-concepts/data-model), [products, variants](https://docs.struct.com/fundamental-concepts/data-management), variant groups or [global lists](https://docs.struct.com/tutorials/guides/how-to-use-import/broken-reference) 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 'Upload assets' unticked and 'Select media folder' empty.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FvMKwiUKyy01VpVl4mN7X%2Fimage.png?alt=media&#x26;token=1063528c-cdac-4b05-bbeb-7acfed41e79f" alt=""><figcaption><p>Import page</p></figcaption></figure>

Having chosen the correct file and import type you can click the "Start upload"-button to start the import.

## Mapping your data

Having clicked the "Start upload"-button you are presented with a new page. This is where you will map your excel columns to data fields on entities.

In this guide we are classifying [products](https://docs.struct.com/fundamental-concepts/data-management), so we choose 'Products' in the 'Entity type' dropdown.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FFC7lWwCklYOHlWPM7g0y%2Fimage.png?alt=media&#x26;token=307ea958-cfda-4933-9d8f-f76b61db2514" alt=""><figcaption><p>Data mapping</p></figcaption></figure>

We choose Name (en-GB) as the key, as that is the column that will map our import to existing [products](https://docs.struct.com/fundamental-concepts/data-management).

Now in this tutorial we are showcasing the three ways to map [products](https://docs.struct.com/fundamental-concepts/data-management) to [categories](https://docs.struct.com/fundamental-concepts/data-model) through import.

This is done by mapping to the three different fields:

* Import classifications (Id)
* Import classifications (Full path)
* Import classifications (ClothingCategoryId)

These fields are built with the following syntax: \[Catalogue name] classifications \[Expected identifier]

So for 'Import classifications (Id)' we import to the [catalogue](https://docs.struct.com/fundamental-concepts/data-model) 'Import' and then we map to a [category](https://docs.struct.com/fundamental-concepts/data-model) with the category's internal id.

'Full path' means we map to the full path of the [category](https://docs.struct.com/fundamental-concepts/data-model) we want to classify the [product](https://docs.struct.com/fundamental-concepts/data-management) in. The full path is build of the display names of the [category](https://docs.struct.com/fundamental-concepts/data-model) to insert into and its ancestors seperated by " > ". E.g. "Clothing > Men > Jackets"

And finally 'ClothingCategoryId' is an [identifier](https://docs.struct.com/tutorials/guides/how-to-use-import/broken-reference) we have created on the Import [catalogue](https://docs.struct.com/fundamental-concepts/data-model).

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2Fj0Gcaje9XpgB5Ih2ZFFG%2Fimage.png?alt=media&#x26;token=75b6f75f-d9c3-4c28-9cec-e2baf383df82" alt=""><figcaption><p>Identifier on Import catalogue</p></figcaption></figure>

## Approve changes

At this point you are shown a 'Review changes'-page showing the new classification(s) that has been added to the entities. The classification on the 'Review changes'-page is always shown as the full path.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FkIdkxUNnI33I7uZKGBjU%2Fimage.png?alt=media&#x26;token=abfb8414-ba19-4af3-bfd2-dc8b56efd2e8" alt=""><figcaption><p>Review changes</p></figcaption></figure>

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.
