# Sales Layer

The Sales Layer PIM stores and manages your data using three different entities[^1]:

* Categories
* Products
* Variants

{% hint style="warning" %}
In addition to these three entities, it is possible to create custom entities, which allow you to store data that is not strictly associated with a specific product or variant (for example, a list of certificates, an author's agenda, etc.).

The EasyCatalog Sales Layer module **cannot import** these entities by default, so it will be necessary to have a custom development or configure an additional Excel or CSV channel in Sales Layer.

[Contact us](https://nousmedis.com/get-in-touch-with-us-2/) so we can help you configure your Sales Layer instance.
{% endhint %}

## 1. Sales Layer configuration

To export your product, category, and variant information to EasyCatalog, you must first create an output channel of the EasyCatalog type.

### 1.1. Create an EasyCatalog output channel

Go to the `Channels` section and click on the `Channel's marketplace` tab. Now locate the `EasyCatalog for Adobe InDesign` channel and click on the `Create` button.

<figure><img src="https://1939597359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazTsFGbHKYYVlYs8LIQv%2Fuploads%2Fbb7rfNbl5PRSH1uAHKM0%2FSL_channels.png?alt=media&#x26;token=4a10317b-41b6-461a-9e82-cf9328ea8d0b" alt="Select the EasyCatalog for Adobe InDesign channel in the Sales Layer&#x27;s Channel&#x27;s marketplace"><figcaption><p>Select the EasyCatalog for Adobe InDesign channel in the Sales Layer's Channel's marketplace</p></figcaption></figure>

### 1.2. General parameters

When you click on the `Create` button (from the previous step), Sales Layer will display the channel configuration wizard:

<figure><img src="https://1939597359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazTsFGbHKYYVlYs8LIQv%2Fuploads%2FShYWHmGEM9eazePnWBV7%2FSL_channel_step1.png?alt=media&#x26;token=51075dc9-8ad7-4069-971d-4a2d814557b3" alt="EasyCatalog channel configuration, Parameters tab"><figcaption><p>EasyCatalog channel configuration, Parameters tab</p></figcaption></figure>

<mark style="color:red;">➊</mark> Sales Layer will first display the `Connector ID`. You must copy and write down this code because you will need it when specifying the connector ID in the EasyCatalog Sales Layer connector configuration dialog box.

<mark style="color:red;">➋</mark> Add a descriptive `Name` for your channel. This will help you distinguish it from other channels when you set up more than one EasyCatalog channel in your PIM.

<mark style="color:red;">➌</mark> Under the channel name, Sales Layer will display the text you add in the `Description` field.

<mark style="color:red;">➍</mark> In order to establish a secure connection between Sales Layer and EasyCatalog, you will need to assign a `private key`. Sales Layer will generate a private key if you haven't created one yet. Please also write down this data, as it is necessary for configuring the Sales Layer data source in EasyCatalog.

<mark style="color:red;">➎</mark> If your Sales Layer instance manages product information in more than one language, select here the languages you want to export to EasyCatalog.

{% hint style="info" %}
When your Sales Layer instance has more than one language, all fields configured as multi-language will be exported using the following pattern: `field name_language code`. For example, a field called `Features` and configured as multi-language will be exported as many times as there are languages you have selected in this option. If you have selected `Spanish` and `English`, it will be exported as `Features_es` and `Features_en`.
{% endhint %}

<mark style="color:red;">➏</mark> `Exporting items with status` will allow you to determine whether to export `all products`, only those marked as `visible`, `visible and drafts`, or `visible and invisible`.

{% hint style="danger" %}
One of the most common mistakes when configuring the EasyCatalog channel is selecting the `Only visible` option. Remember that, by default, Sales Layer marks a newly created or imported product as `Draft`. With the `Only visible` option selected, EasyCatalog will only receive products with `Visible` status, and you will no longer receive your most recent products, because their default status will be the `Draft` status.
{% endhint %}

The option `Include empty categories` will send to EasyCatalog all the information for each category, even if it does not have any products assigned to it. Leave this value set to `No` to prevent your EasyCatalog panel from receiving more data than necessary.

### 1.3. Output data

Click the `Continue` button to access the `Output Data` tab.

<figure><img src="https://1939597359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazTsFGbHKYYVlYs8LIQv%2Fuploads%2F1z70CRP17KmEKtZavG33%2FSL_channel_step2.png?alt=media&#x26;token=89c5495d-1907-4f1e-8ae7-0f7dfa6b6e8c" alt="Sales Layer EasyCatalog connector output data tab"><figcaption><p>Sales Layer EasyCatalog connector output data tab</p></figcaption></figure>

<mark style="color:red;">➊</mark> In the first section, you must select each of the entities to be exported. Remember that EasyCatalog only natively supports the following entities: `Categories`, `Products`, and `Variants`. If you can't see one of the entities you want to export, click the `+ Add Table` button and select it from the drop-down list.

{% hint style="success" %}
Please [contact us](https://nousmedis.com/get-in-touch-with-us-2/) if you want to set up an import connector that imports data straight from your custom entities.
{% endhint %}

<mark style="color:red;">➋</mark> The `Activate` option allows you to include the current selected entity in the output data (`Yes`) or exclude it (`No`).

<mark style="color:red;">➌</mark> Enter the name you want to give the entity in the output channel.

{% hint style="danger" %}
Do not change the default value proposed by Sales Layer, or EasyCatalog will not be able to recognize the table.
{% endhint %}

<mark style="color:red;">➍</mark> If you only want to export part of your product catalog, select a category from this drop-down list. Leave the value blank to export all products from all categories.

{% hint style="info" %}
In Sales Layer, a product can belong to more than one category. When this happens, Sales Layer will export the product as many times as it has categories assigned. In this case, it is very important to select the `ID` field as the key field when configuring the panel in EasyCatalog; otherwise, EasyCatalog will return an error for duplicate records and will not be able to complete the import correctly.
{% endhint %}

<mark style="color:red;">➎</mark> If you want to filter the data that the channel will export, you can enter a search string: Sales Layer will only export the items that meet the search criteria.

<mark style="color:red;">➏</mark> By default, the EasyCatalog channel will display all fields of the selected entity. Each line represents a field. You can change the order of the fields by dragging them up or down.

1. A padlock icon means that the field cannot be deleted nor modified (it is necessary for the correct import from EasyCatalog).
2. The `Type` option determines how the data will be exported: `Normal` (string or numbers), `Image` (will export the download URL of the image file) or `Template` (allows you to define other custom output formats, such as JSON or XML).
3. The `Name in EasyCatalog` column allows you to change the name of the field that EasyCatalog will receive. This option cannot be modified in locked fields.
4. The `Related field` column allows you to choose which field to export in that row. If the field does not exist in your PIM and you want, for example, to export a constant value, select the empty field option and then use the `+ Formula` button to enter a value or formula.

<mark style="color:red;">➐</mark> Sales Layer features a powerful formula editor that allows you to manipulate the content and format of each field during the output.

<figure><img src="https://1939597359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazTsFGbHKYYVlYs8LIQv%2Fuploads%2Fi4D7WbSmv0gvKdR1VHKN%2FSL_formula_editor.png?alt=media&#x26;token=99dc0ffd-14c9-4006-82b9-b877205ccf3a" alt="Sales Layer formula editor"><figcaption><p>Sales Layer formula editor</p></figcaption></figure>

<mark style="color:red;">➑</mark> Image fields allow you to export one or more versions (formats) of your images. To create a high-quality catalog, always choose the `Original (ORG)` version of an image.

Repeat the same steps to configure each of the entities (`Products` and, optionally, `Variants`).

## 2. Configuring a Sales Layer Data Source in EasyCatalog

This is the easiest step. To begin, select `File > New > EasyCatalog Panel > New Sales Layer Data Source`. The following dialog box will open:

<figure><img src="https://1939597359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazTsFGbHKYYVlYs8LIQv%2Fuploads%2FbjebLEGt0ctlzoXnzaFA%2FSL_data_source.png?alt=media&#x26;token=97f9d3cd-4ebb-401a-9845-605d5b531388" alt="Sales Layer Data Source Configuration dialog box"><figcaption><p>Sales Layer Data Source Configuration dialog box</p></figcaption></figure>

Configure the different options in the dialog box by following these instructions:

1. Start by assigning a name to your data source. This will be the name used by the data panel that will be created when you click the `OK` button.
2. Paste the `Connector code` and the `Private key` that you created in the previous step, during the configuration of the EasyCatalog connector in Sales Layer.
3. In the `Version` field, leave the default value provided, 1.18. To use the old Sales Layer API, enter 1.17.
4. If your Sales Layer configuration uses the `Variants` entity, check this box to be able to import them.
5. Click the `Apply` button so that EasyCatalog connects to Sales Layer and validate that the credentials and options you have selected are working as expected. If everything is correct, EasyCatalog will display a preview of the fields you configured in the Sales Layer output channel.
6. If a product belongs to more than one category in your Sales Layer instance, or if you have decided to import variants, use the `ID` field as the `key field`. Otherwise, EasyCatalog will return an error for duplicate records. By default, the `ID` field is already marked as the key field.
7. Click the `OK` button to finish. EasyCatalog will display a new data panel with the name you provided in the first step.

[^1]: A Sales Layer entity would be the equivalent of a table in a relational database.
