# How to use File templates

## Navigating to File templates

You can find File templates by navigating to Settings > General > File templates.

This will present you with an overview of all file templates currently in the system.

To create a new File template click the "+ Create file template"-button in the top-right corner.

## Setting up the basics

Having clicked "+ Create file template" you are presented with the 'Create file template'-page.

We start by setting up the basics, like name and the type of the entity you wish to import.

Next we have the option of limiting the file template to only certain user groups by adding them under 'Availability'. In this tutorial we have elected to allow all user groups to use the file template so we leave it empty.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FT3HeWoPYMARSYRR7eeyI%2Fimage.png?alt=media&#x26;token=24668bf6-9b9e-4bf5-a5f0-c71c7a10bf96" alt=""><figcaption><p>Create file template</p></figcaption></figure>

You can choose to enable 'Use fallbacks' if you want empty localized or segmented values to fallback and finally you can choose the direction, import or export.

For direction you have three options:

* Import only - This file mapping only works when importing
* Export only - This file mapping only works when exporting
* Import and export - This file mapping works when importing and exporting.

For this tutorial we only want the file mapping to work when importing.

## Setting up the mappings

Under 'File field map' you can click the "Add field"-button to add a field mappings, these fields represent the mapping of a column to an [attribute](https://docs.struct.com/fundamental-concepts/workflows-and-automation) in the PIM. You can add as many as you wish.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FpDZI1f9k5QV7vKh73C7q%2Fimage.png?alt=media&#x26;token=40eb958c-84ca-4e5b-8a1d-d9736ff2d9a9" alt=""><figcaption><p>Fields template with one column to attribute field added</p></figcaption></figure>

For this tutorial we need three fields.&#x20;

The 'File data field' represents the name of a column in the excel spreadsheet and the 'Map to'-field represents an [attribute](https://docs.struct.com/fundamental-concepts/workflows-and-automation) in the PIM.&#x20;

The excel spreadsheet we are using in this tutorial has the headers 'ProductName', 'Brand' and 'Price'. They map to 'Name (en-GB)', 'Brand' and 'Cost Price (DKK)' respectively.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FaMw2Tf2H5JxId1jgcD0m%2Fimage.png?alt=media&#x26;token=87a439c3-77d6-4e73-8acd-4a4faaf1d53a" alt=""><figcaption><p>Fields mapping with three columns and mapping filled in</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/fundamental-concepts/data-management) in the system, that [product](https://docs.struct.com/fundamental-concepts/data-management) will be updated with the data from the excel spreadsheet.

You have now created a file template. To finalize the creation click the "Save"-button in the bottom-right corner to save your file template.

## Where do I find my file mappings when importing

Next time you import entities for which you have a File template, you can click "Load file template" on the data mapping page.&#x20;

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FKpoF9HJkWtdM2h6lOPuk%2Fimage.png?alt=media&#x26;token=26abe63f-cc67-4000-99c5-2de89e508c79" alt=""><figcaption><p>Data mapping page</p></figcaption></figure>

This will reveal a menu showing all of the file templates available to you.

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2F9Tv2cWm3M1Jw1YspRo4y%2Fimage.png?alt=media&#x26;token=2532e643-19b8-49b4-bf97-2cf697c0ab28" alt="" width="250"><figcaption><p>Load file template menu</p></figcaption></figure>

Choose your File template in the dropdown and click "Submit".

<figure><img src="https://2141378775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuUonpFWM7AJ0xVVXV1tr%2Fuploads%2FsYN2QlTtgXtyQIMhD1zE%2Fimage.png?alt=media&#x26;token=721c3b60-e7e7-4a1a-bb4a-9007e5786366" alt=""><figcaption><p>Data mapping with loaded file template</p></figcaption></figure>

Now your File template is loaded and you can cherish the time you saved mapping and click "Next" to continue importing.
