# How to import products

## Before importing

A prerequisite to importing any entities 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 clothing.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FMNYBHw0nY5p7UZdRTNGg%2Fimage.png?alt=media&#x26;token=25e9711e-6d44-45f7-ac99-6e59d6c59dde" alt=""><figcaption><p>Excel spreadsheet with headers and data</p></figcaption></figure>

## 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/pim3/fundamental-concepts/catalogues-and-categories), [products, variants](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants), variant groups or [global lists](https://docs.struct.com/pim3/fundamental-concepts/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.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FlsieAQGf51XFSWVldrUg%2Fimage.png?alt=media&#x26;token=eee0dbe2-de6a-4faf-bcf5-5f08a13d3320" alt=""><figcaption><p>Import page</p></figcaption></figure>

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

## Mapping your data

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 entities.

You will need to choose the correct Entity type; [Categories](https://docs.struct.com/pim3/fundamental-concepts/catalogues-and-categories), [Products, Variants](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants), Variant groups or [Global list](https://docs.struct.com/pim3/fundamental-concepts/global-lists) values.

In this guide we are importing [products](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants), so we choose 'Products' in the 'Entity type' dropdown, but the process for all entities are almost entirely similar from here.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FuOYEdENaKjnhZyufNmQ0%2Fimage.png?alt=media&#x26;token=7e8781f1-b78c-4801-b8f9-078132e8f5a2" alt=""><figcaption><p>Data mapping</p></figcaption></figure>

Next is mapping the actual data. The import function will try to automap the data from the file by matching the name of the excel column to the name of an [attribute](https://docs.struct.com/pim3/fundamental-concepts/attributes) in the PIM.

This is not always possible or what you want, in which case you can manually select the correct [attribute](https://docs.struct.com/pim3/fundamental-concepts/attributes) to map to in the 'Select field' dropdown in the 'Map to' column.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FXICwFBRhbW6VLtCKOntO%2Fimage.png?alt=media&#x26;token=7ba8be45-988c-448f-948e-8c700b7e8ab6" alt=""><figcaption><p>Data mapping</p></figcaption></figure>

Having finished the mapping, you need to choose one or more keys. These key(s) will act as keys to match existing entities in the system. If the key(s) match a [product](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) in the system, that [product](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) will be updated with the data from the excel spreadsheet.

If the key does not exist, a new [product](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) with the data from the excel spreadsheet will be created.

{% hint style="info" %}
If you know you will be using this mapping often, you can save it by clicking 'Save mapping' and giving it a name. This way you can always load your mapping again when using a similar excel spreadsheet.
{% endhint %}

Having chosen one or more keys you can click "Next" in the right-bottom corner.&#x20;

## The file contains new products

As mentioned in the last section, if a key does not already exist in the PIM, a new [product](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) will be created. If the excel spreadsheet contains new [products](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) you will be prompted to choose a [Product structure](https://docs.struct.com/pim3/fundamental-concepts/product-structures) to use for the new [products](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants).&#x20;

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FG6Vx3jDTi7PYBZGv8GKQ%2Fimage.png?alt=media&#x26;token=87010edd-6ce8-4204-bcb1-ec8f1b08e8d3" alt=""><figcaption><p>The file contains new products</p></figcaption></figure>

In this guide we are importing clothing, so the 'Clothing' [product structure](https://docs.struct.com/pim3/fundamental-concepts/product-structures) is chosen.

Click the "Next"-button in the right-bottom corner to continue.

## Approve changes

At this point you are shown a 'Review changes'-page. This page will show you the amount of new and updated items. New items will be denoted by having a blue 'New'-tag in the key column whereas existing [products](https://docs.struct.com/pim3/fundamental-concepts/products-and-variants) will show their current value.

[Attributes](https://docs.struct.com/pim3/fundamental-concepts/attributes) that will be changed are colored green to easily distinguish between [attributes](https://docs.struct.com/pim3/fundamental-concepts/attributes) that will remain the same and [attributes](https://docs.struct.com/pim3/fundamental-concepts/attributes) that will change.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FXaNq9jkH0axgNn7Xmv2p%2Fimage.png?alt=media&#x26;token=54071792-1b52-48f1-8028-654c490614a4" 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.
