Skip to content

Importing data with an import layout

Availability

Related licence features: Customers Update from CSV, CSV Based Stock Update, Invoicing by CSV.

Features vary with the edition and configuration you subscribe to: check your licence for the features it includes. Why can't I see a feature?

Data Import reads a CSV file with your own columns, for example a list of customers kept in a spreadsheet. You describe the file once in an import layout, test the file, then import it. This page uses customers as the example; documents pages use the same screens.

This page is for administrators. For the other ways to import, see Importing data.

1. Save the spreadsheet as CSV

  1. In your spreadsheet, keep one header line with the column names, and one record on each line below it.
  2. Save a copy of the sheet as a CSV file (in Excel: Save As, with a CSV file type). Only the values of the sheet are kept.
  3. Open the CSV file in a text editor and note which character separates the columns (for example ; or ,), how dates are written and which decimal point the numbers use. The layout needs these three.

2. Create the import layout

  1. Open Customers, select Import File, then Data Import at the top right. The list of import layouts opens. (On a documents page such as Invoicing, select the series, then Data Import.)
  2. Select New and fill in the layout:

    Field What to enter
    Layout A short name for the layout, for example CUSTOMERS
    Description What the layout is for
    Input File Your CSV file
    Separator Character The character between columns: ;, ,, \| or Tab
    Header Line Tick it when the first line of the file holds the column names
    Input Date Format How the file writes dates: 2011-12-31, 31/12/2011, 12-31-2011 or dd-mm-yyyy
    Decimal Point . or ,, as the numbers of the file use it
    Update Customer Data For document layouts: see Update Customer Data
    Host, Database, User Name, Password, Query Leave empty to import from a file
  3. Select Save. The layout's details show each column of the file, and the Destination Table and Destination Field Gestix matched it to by its name. A column with no match is left empty.

A new import layout for customers

A layout for a semicolon-separated file with a header line and a comma as decimal point.

3. Match each column to a Gestix field

  1. Go back to the list of import layouts. The Header column shows a tick for each layout with Header Line.
  2. Select your layout. The import screen shows one row per column of the file: Import Field (the column name), Destination Table and Destination Field.
  3. For each column with no field: choose the Destination Table (for customers: Customer, Postal Address, Shipping Address or Contact), select Check, then choose the Destination Field.
  4. Select Save Layout.

The layouts of the Customers list

Five test layouts; DOC-NOHDR is the only one without a header line.

The columns of the file and their Gestix fields

Code was matched by hand to Customer ID; the other columns were matched by their names.

Options of each column

Each column has these options on the import screen:

Option What it does
Ignore The value of the column is not stored.
As Attr The column ticks an attribute. A non-zero number or true ticks the attribute named after the column (its Import Field). For customers and suppliers, any other value ticks the attribute named after the value itself; for articles, other values are ignored. An attribute that does not exist yet is created, as a search criterion. The import never unticks an attribute.
Add The value is added after the field's existing value: after a space for customers, suppliers, addresses and articles, after " - " for the fields of a document's header, and with nothing between for document lines.
Prefix The value is stored after the column name and =, for example Colour=Red for a column named Colour. With Add as well, it is added after the existing value: <existing value> Colour=Red.
Filter Only the rows whose value in this column contains the text are imported. Upper and lower case count, and a row must pass every filtered column.

On document layouts, New groups the rows into documents: a column marked Document starts a new document each time its value changes, and a column marked Item starts a new line. Without a Document column, all the rows form one document; without an Item column, each row is one line.

Update Customer Data

Update Customer Data is for document layouts, where the licence includes invoicing by CSV. When it is ticked, importing documents also updates the existing customer, found by its code or its VAT ID, and the customer's billing and shipping addresses, from the customer columns of the file. It also updates the descriptions of existing services on the lines. When it is not ticked, the import does not change existing customers.

4. Test, then import

  1. Under Input File, choose the file again.
  2. Select Test. Gestix reads the file and reports Rows processed and New Items, with the records it would import. Nothing is saved.
  3. Check the report: the records are those you expect, each column is in the right field, and the column names are not listed as a record.
  4. Choose the file again and select Import File. The same report shows what was imported.

About these screenshots

This example comes from a fictitious tenant in one country. Document names and formats follow that tenant's configuration and tax model; they do not limit how Gestix works in other countries.

The Test report of two new customers

Test: New Items 2, the two customers of the file.

A record already in Gestix is marked with * after its code and is not counted in New Items. Importing the same file twice does not create the customers twice: the second import reported New Items: 0.

When the import does not work

The column names are imported as a record. If Header Line is not ticked, Gestix reads the first line of the file as data: the report lists a record such as "Code, Name, VAT ID…" and counts it in New Items. Create the layout with Header Line ticked, and test again.

A Test report with the header line read as a record

Layout without Header Line: the line "Code, Name, VAT ID…" is counted as a new item (New Items 3 for two customers).

"Customers must have Tax Number", "Import failed line 2". A new customer must have a VAT ID when the company requires it: Admin › Settings, part Fiscal, Required Data set to VAT ID or VAT ID + Email. Add a VAT ID column to the file, match it to VAT ID (table Customer), and test again. The line number counts the header line.

Test also showed this message for new customers without a postal address and zip code, with Required Data empty. Match those columns to Postal Address and Zip Code (table Postal Address).

Allow duplicates, in the same part of Admin › Settings, decides whether the import matches customers by their VAT ID.

The wrong file was imported. The import screen shows the name of the file the layout last read, next to Input File. Check that name and the records of the Test report before you select Import File.