Channels: Importing Content (Automatically)

Connectors: General Aspects

 

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 Overwrite always when importing. In the case of answering affirmatively, the information of the PIM will be overwritten with the contents of the connector file. Otherwise, only changes made to the csv file will be imported. If so, if we need to overwrite everything in a timely manner, the connector should be refreshed directly.

Force refresh

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.

Only import existing items

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.

After writing ‘ftp:’ the channel will directly ask us the user name, keyword and port.
After writing ‘ftp:’ the channel will directly ask us the user name, keyword and port.

It is required that the remote server doesn’t block Sales Layer IPs. In a server with firewall, the following IPs should be added to the whitelist:

52.16.19.36 for cloud.saleslayer.com

52.16.206.155 for api.saleslayer.com

52.16.132.188 for backprocess servers

 

The last step would be to link the file or the csv files of each table that we want to synchronize. You can add a url directly and if it is ftp type you will ask us for the login and password for more security.

Warning: it is essential that the fields that we write in the connector in Name on Import are called the same as they appear in the csv.

Once we have chosen the ones that we are going to synchronize, we have to choose 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.

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.

Redesigning form, it’s possible to block a field so the user doesn’t waste time changing a content that later will be modified by the import channel
Redesigning form, it’s possible to block a field so the user doesn’t waste time changing a content that later will be modified by the import channel

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. Simply add in the formula that before promotions take a ++ ahead.

Example:

Applying in the category field a formula like this:

IF ({PRICE} <50, "++ PROMOTION"))

We would do that if the PRICE field is less than 50, add PROMOTION.

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

Tip: if you want to add a column from Csv in two fields, you can do it by using the formula GET_COLUMN_VALUE.