Import dialog

Using an import dialog you can import files in Excel or CSV format. More precisely, if the import file contains a table whose rows describe subject objects modeled in the TL app, the import dialog creates corresponding subject objects, where column names serve as attribute names and column values serve as attribute values.

Configuration

Sequence

To configure an import dialog, you have to pay attention to the order:

  1. In the "Import Excel file" section, one must upload a sample file to simply select from the existing column names when filling in the configuration properties. Even if the actual import file contains several sheets and tables of data, it may not have been provided by the customer yet, or it may be too large to serve as an example. Therefore, the sample file must contain only the sheet to be imported with the table header.
  2. In the "Import Configuration" section:
    1. "Conversions": Some column values may need to be converted before they can be used as keys in an object dictionary (see below).
    2. "Object dictionaries": One must create an object dictionary (see below) for each relevant type before one can work with the objects.
    3. "Import steps": A rough guideline for the order would be:
      1. First you should create objects.
      2. Then look up objects or create references between objects.

In general, since many configuration options are automatically calculated only from the already filled configuration properties, some optional or polymorphic properties work only after re-inserting or selecting them. Therefore it would not be advisable, for example, to assemble first the import steps not filled in as pure placeholders in correct order.

Object dictionaries

Each object directory plays the role of a transient partial database, which is automatically filled with the objects of the configured type. The (possibly composite) key is determined according to the given configuration:

  • for the already existing (persistent) objects - from the attributes;
  • for the newly imported objects - from the column values.

Arguments

Many expressions in import are applied (instead of usual fixed arguments) to "Arguments" group, where you can configure arguments of the following types yourself:

  • Model - represents the import model.
  • Column - represents the value of a column from the import file.
  • Object(s) - represents one or more objects created or looked up in "Import steps" and given a name as an object argument.

Example

In the TL demo under

Administration > Subject. Administration > People > Import...

there is an import dialog whose configuration can be viewed in design mode.