Bitrix Site Manager

Importing CSV files

In this section

  • Import preconditions
  • Importing a catalog
  • Example of import file
  • Import preconditions

    The system provides for populating and modifying the catalog through the use of external CSV files (comma-separated values). Values in CSV files can have any separators in it. This form is user to upload CSV files to the site and fill the catalog with the product information.

    Since CSV files does not maintain information on the catalog structure and product properties, it is essential that you create the catalog structure before you start uploading your CSV file.

    Perform the following operations to create the catalog structure.

    1. Create and customize an appropriate information block (if you have not created it yet).
    2. Create all the required properties in the information block.
    3. Convert the information block to a catalog (see Commercial Catalog).
    4. Upload product pictures to the site (if you intend to use images).

    Importing a catalog

    The following steps disclose the import wizard operations.

    Step 1
    1. Open this form (e-Store -> Commercial catalog -> Data import -> Import CSV (new)).
    2. Click Browse... to locate a CSV file and set the field Data file from local computer if a file is stored on your local disk.
      If the data file is stored on your site, find it in the folder tree.
      If your local data file has large size, it is recommended to upload it via the FTP protocol before you proceed.
    3. Select the information block in which you will load the information.
    4. If you have created an import scheme once, you can select one. In this case, all the subsequent steps are omitted and the import starts immediately.

      The scheme must be fully compliant with the imported file. Otherwise, the import result is unpredictable.

    5. Click Next to go to the second step.
      If you have selected the import scheme, the import procedure will start immediately.
    Step 2
    1. Select the appropriate CSV file format: with separators - fields are separated with a special symbol (e.g. a comma or a space) or fixed field width. Depending on your choice, you will have to customize the corresponding settings:
      • if you have chosen with separators, set the Field separator to the one used in your file;
      • if you have chosen fixed field width, specify ordinal numbers of the separating columns in the field Separator marks.
    2. If the first row in a file contains names of fields, check the box First row contains field names. If you check this option but the file's first row contains data instead of names, the first row will be processed incorrectly.
    3. Click Next to go to the next step.
    Step 3
    1. Assign file fields to database records. Order of fields in a file may differ from that in the catalog database. This is why it is essential to assign fields to records correctly.

      If a field is the grouping node, assign it a value of Group of level X.

      The values Unique identifier (B_IBLOCK_ELEMENT.XML_ID) and Name (B_IBLOCK_ELEMENT.NAME) are mandatory, you must assign any one of them. These fields are used to match products in a file and products in the database.

      Please ensure that fields are matched correctly. Otherwise, the import result is unpredictable.

    2. If you are loading products with pictures, please upload pictures to the site via the FTP beforehand. Specify the path to images in the corresponding field.
    3. Instruct the system what to do with products currently in the database but absent from the imported CSV file:
      • choose remove to totally replace products in the catalog with those in a file;
      • choose deactivate to just hide products from visitors;
      • choose leave to add data from file to the database.
    4. If you plan to import similar CSV files on the regular basis, you can save the import scheme and use it with subsequent import operations.

      The stored scheme can only be applied to files with the same structure. Otherwise, the import result is unpredictable. 

    5. Click Load data to start importing.

    Example of a correct CSV file

    ID;Name;Qty;Battery_Prop;Group;Sale from;to;Base price;Curr;Retail;Curr
    295;Siemens S55;10;90;Li-Ion;Siemens;1;10;160.00;USD;251.20;USD;N
    295;Siemens S55;10;90;Li-Ion; Siemens;11;20;150.00;USD;235.50;USD;N
    295;Siemens S55;10;90;Li-Ion;Siemens;21;;140.00;USD;219.80;USD;N
    297;Siemens S46;2;680;Li-Ion;Siemens;1;10;85.00;USD;100.73;USD;N
    297;Siemens S46;2;680;Li-Ion;Siemens;11;20;80.00;USD;94.80;USD;N
    297;Siemens S46; 2;680;Li-Ion;Siemens;21;;75.00;RUR;88.88;RUR;N
    325;Siemens U15;5;720;Li-Pol; Siemens;1;10;310.00;USD;367.35;USD;N
    325;Siemens U15;5;720;Li-Pol;Siemens;11;20;290.00;USD;343.65;USD;N
    325;Siemens U15;5;720;Li-Pol;Siemens;21;;270.00; USD;310; USD;N