Connectors: Importing Content (Automatically)
To automate the import of data from external sources such as an ERP, Sales Layer has an import connector. Its operation is based on the loading of a CSV periodically to insert or update content.
When activating the connector, the first thing we have to do is assign a private key. Then, we must decide if we are interested in the option of
Also in Parameters, there is another key configuration option: if we select Overwrite when importing, no new records will be created. This option will only be updated when references from the CSV file match those we have in Sales Layer, and thus avoid loading more products or variants in the PIM.
Continuing with the input connector, in the following tab, we find all the tables (Categories, Products, Variants, and Points of Sale) and their corresponding fields that we can update using this channel. The only mandatory field to link with category, product or variant is the item reference. As in other connectors, you can cancel any of these tables and leave the ones that interest you selected.
Also as in other connectors, when importing/updating the items it is possible to apply formulas. In the case of an input connector, we can do things like:
- Change product status if certain conditions are met.
- Change the category some products belong to.
- Change or add labels, etc.
It is good to keep in mind, that the more formulas are applied, especially if they are of a certain complexity, synchronization will take longer. In the formula documentation, we will give you more information on how they work.
The last step would be to link the file in each table that you want to synchronize. You can add a URL directly or type FTP and you will be asked for login and password.
Warning: Please, note that the FTP needs to have a certificate signed by a certification authority. Following the security standard in apps, we do not accept self-signed certificates.
It is required that the remote server doesn’t block Sales Layer IPs. In a server with a firewall, the following IPs should be added to the whitelist:
Warning: The fields that we write in the connector in Name on Import must be called the same as they appear in the CSV.
Once we have chosen the ones that we are going to synchronize, we have to select the frequency (hourly, daily, etc.). Keep in mind that at the chosen time the file will be queued, the update will not be done immediately but will start when it is your turn and will take more or less time depending on the length and complexity of the formulas applied.
Note: If you want to import a CSV field into two different Sales Layer columns, you can use the GET_COLUMN_VALUE formula.
Another key aspect that needs to be understood with the input connectors is that if there are fields in Sales Layer synchronized with an input connector, what a user modifies from the account can be lost if the input connector updates that content. That is, let's say you have a connector that updates the description every night: the changes you make in the description in Sales Layer will be lost the next night when updating from the CSV file. To avoid this situation, we can block those fields so that the user cannot make changes in those PIM fields. We can do this when setting up a family or editing form.
An additional note that may be useful is that in the input connectors, it is possible to add information in some fields without deleting what has been previously and without duplicating content. We give you an example: you have the T-shirt category and you want to add the Promotions category without deleting the previous one, and without reloading the CSV you add another category of Promotions. To do this, you could directly use ++ in the CSV or do it by adding the values in a formula containing ++ before Promotion. For example, this formula could be applied to the category field as in the following example:
IF ({PRICE} <50, "++ PROMOTION"))
We would do that if the
Keep in mind, both in case of a periodic synchronization or in case of a manually forced one, the synchronization will be queued, and depending on the server load it will be done in more or less time (regularly it takes a few minutes to start, but it is not immediate).
Warning: To import multi-language content, map the corresponding field in the connector, and the import file indicates the language in the column name. To do this, use a colon and the language ISO (for example. :en; :de; :fr; …) creating one column per language.
Tip: If you want to add a column from CSV in two fields, you can do it by using the formula GET_COLUMN_VALUE.
Note: API 1.18 can import large CSV files, either through manual import or automated import via connectors.
Note: Linked CSVs should not contain special characters in the name to avoid any issues with downloading (spaces, commas, quotes, periods, etc.).
Please, bear in mind that Sales Layer, as a product information management system, is not designed to manage stocks. However, it is possible to store the stock data like any other content. For this it is important to take into account that:
- It may not work with the immediacy necessary to manage stocks, especially depending on how the content is transferred into Sales Layer (slower with CSV imports and faster with an implementation via API which would speed up the uploading process).
- Whenever you modify product fields, all those products affected by the modification are sent by the API connectors in which the modified information is managed. As a consequence, updating the stock data of a consistent part of products, as it is supposed to happen, will considerably reduce the speed of the updating processes.
Note: Should the CSV contain the same reference on different lines, the connector will only import the first one and discard the following the same references.