Skip to main content

Csv - Item sync

CSV Connector - Item Update The Item Update process syncs items, prices, stock, filters (attributes), and images from CSV and ZIP fil...

Updated over a week ago

CSV Connector - Item Update

The Item Update process syncs items, prices, stock, filters (attributes), and images from CSV and ZIP files located on an FTP server. The process can run in two modes: a full sync that first wipes all existing item data, or an incremental update.

Data Source Configuration

The connector retrieves data from an FTP location defined in the administration settings. It looks for specific files in designated subfolders. The FTP server details (Address, Username, Password) must be configured.

  • Items: Reads all *.csv files from the /items/ directory on the FTP server.

  • Item Filters: Reads all *.csv files from the /itemfilters/ directory on the FTP server.

  • Item Images: Reads a single ZIP archive (e.g., itempictures.zip) from the root FTP directory. This is only processed if images are not set to be synced via the main FTP Picture Sync task.

Data Mapping: Items

Item data is read from the CSV files in the /items/ folder.

App4Sales Field

Source Field (CSV Header)

Logic/Notes

ItemCode

ItemCode

The unique identifier for the item. Records without an ItemCode are skipped.

EanCode

EANCode

The EAN barcode for the item.

Description

Description

Main item description.

Description2

Description2

Additional description field.

Description3

Description3

Additional description field.

Description4

Description4

Additional description field.

Description5

Description5

Additional description field.

SearchDescription

SearchDescription

Text used for searching the item in the app.

SalesPrice

SalesPrice

The base consumer sales price. The value is parsed as a decimal using an invariant culture (e.g., "123.45").

Currency

Currency

The currency code for the base sales price (e.g., EUR, USD).

VatIncluded

VATIncluded

A character indicating the VAT calculation method. Defaults to 'E' if parsing fails.

VatPercentage

VATPercentage

The VAT rate as a number. Parsed as a decimal using an invariant culture.

LastAvailableStock

LastAvailableStock

The stock quantity. Parsed as a decimal using an invariant culture.

Unit

Unit

The sales unit of the item (e.g., PCS, BOX).

MinimumOrderQuantity

MinimumOrderQuantity

The smallest quantity that can be ordered. Parsed as a decimal using an invariant culture.

PurchasePackageSize

PurchasePackageSize

The quantity per purchasable package. Parsed as a decimal using an invariant culture.

CreatedDate

CreatedDate

The creation date of the item. If parsing fails, it defaults to the current sync time.

NextDelivery

NextDelivery

The next expected delivery date for out-of-stock items. The expected format is `yyyy-MM-dd`.

FreeItemFields

FreeItemFields

Contains custom field data. See the "Free Fields" section for details on formatting.

Data Mapping: Price Lists

The connector can dynamically read additional price lists from the item CSV file. Columns must be named in the format salesprice[Number], for example, salesprice1, salesprice2, etc.

App4Sales Entity

Source Field (CSV Header)

Logic/Notes

PriceList

salesprice1, salesprice2, ...

A new Price List is created for each unique number found (e.g., "PriceList 1"). The number becomes the Price List ID and Code.

PriceListPrice

salesprice1, salesprice2, ...

A price record is created linking the item to the corresponding price list with the specified price. Zero or empty values are skipped.

Data Mapping: Item Filters (Classes & Values)

Item filters (attributes/classifications) are read from the CSV files in the /itemfilters/ folder. These are used to create filter options in the app.

App4Sales Field

Source Field (CSV Header)

Logic/Notes

ItemClass (Name)

ItemClass

The name of the filter group (e.g., "Color", "Brand"). The connector also checks FilterName, ItemFilter, and Niveau1 as fallbacks.

ItemClassValue (Value)

Value

The specific value for the filter (e.g., "Red", "Nike"). The connector also checks FilterValue and Niveau2 as fallbacks. If none of those are present, it defaults to "Ja" (Yes).

(Link to Item)

ItemCode

This field links the filter value to a specific item.

Sequence

Sequence

Determines the display order of the filter values.

Domain Specifics

Price Logic

Pricing is handled in two ways. A single base price is defined by the SalesPrice and Currency columns in the main item CSV. Additionally, multiple price lists for B2B scenarios can be provided by adding more columns to the item CSV file, named as salesprice1, salesprice2, and so on. The number in the header is used as the ID for the App4Sales Price List.

Image Handling

Item images are sourced from a ZIP archive (e.g., itempictures.zip). The connector extracts files with .jpg, .jpeg, and .png extensions. The filename itself is used to link an image to an item. The code uses a helper function to parse the filename, which likely expects a convention such as ITEMCODE_SEQUENCE.jpg (e.g., SHIRT01_1.jpg, SHIRT01_2.jpg). This process is skipped if the "Use images only from PIM" setting is active in the portal.

Stock & Availability

Stock is provided in the LastAvailableStock column in the item CSV file. There is no specific multi-warehouse logic in this connector; it is a single stock value per item. The NextDelivery field can be used to show when an item is expected to be back in stock.

Free Fields

The connector supports two formats for free fields, controlled by the UseDeprecatedFreeFieldsFormat setting.

  • Modern Format (default): The FreeItemFields column should contain a string of key-value pairs, separated by semicolons, with the key and value separated by a colon. For example: Material:Cotton;Origin:Vietnam.

  • Deprecated Format: The FreeItemFields column is treated as a single text value. Commas are replaced with periods. This value is assigned to a single free field with the hardcoded caption "Vrij veld", unless the `HideFreeFieldCaption` setting is enabled.

Special Logic & Filters

  • Data Cleaning: If the CleanData setting is enabled, the connector will execute a TRUNCATE TABLE command on items, ItemPrices, PriceLists, itemclasses, and itemclassvalues before importing. This erases all existing item data.

  • Record Skipping: Item records from the CSV file are completely ignored if they do not have a value in the ItemCode column.

  • Price Skipping: Prices from dynamic `salesprice` columns are not added if the value is zero or empty.

Related Settings & Prerequisites

The following connector settings in the portal control the item sync behavior:

  • Clean data: If checked, all existing item, price, and filter data will be deleted before the sync starts. Use with caution.

  • Separator character used in import files: Defines the column separator for all CSV files. Defaults to ; if left empty.

  • Use deprecated free fields format: Enables the old single-value free field logic.

  • Hide free field caption: Hides the "Vrij veld" caption when the deprecated free field format is used.

Did this answer your question?