You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 68 Next »

Import engine allows administrators to collect data from various data sources, and then map this data into relevant tables.

The SimpleOne import engine features the following:

  • different data sources types are supported
  • different file formats are supported (if you choose "File" as the data source).


You can choose the data source, place the data from it to the temporary table (also can be called "an import set"), and after that, with the transform maps and the field maps, you can map the data from the source with the target tables.

You can find graphical procedure view of the import process below. A more detailed description is provided further in this article.

Key terms


ConceptDescription
Import sourceA record specifying what data an import set should import. 
Import set

A record containing references to raw data uploaded to the staging location. Also, this record returns information about this import attempt state.

Import set table

An automatically generated table used as temporary storage for imported records before transformation. The structure of the table is automatically generated depending on the imported data.

Transform

The conversion of data according to the transform map and transform scripts that also define the source table (the import set) and the target table.

Transform Map

In this set of field maps, the correlations between fields in an import set table and fields in a target table are specified.

Transform ScriptA script allowing to customize import operations using a native JavaScript extended with SimpleOne Server-Side API.
Field MapA relationship between a field in an import set table and a field in a target table.
Coalesce

An option related to the transform process. This option allows updating existing table records within the transform process.

For more information, please navigate to the relevant article part: Coalesce.


General import procedure description


  1. Prepare raw data.
  2. Create an import source.
  3. Load raw data into the import set table.
  4. Create a transform map.
  5. Create field maps.
  6. Run a transform.
  7. Verify results.


Role required: export_admin.

Import Sources


Creating an import source is necessary to load raw data into system for further processing and transformation. You can set up an import source able to work with the different data source types and file formats.

  1. Navigate to Import → Import Sources.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.
FieldMandatoryDescription
NameYDisplayed import source name.
Import Set Table NameYImport set table name.

Type

N

Type of the import source. Available choice options:

  • File
  • Text
  • LDAP.
File Retrieval MethodN

Choose the method of the file adding to the import source (if relevant Type was chosen earlier). Available choice options:

  • Attachment.
FormatY

Choose the file format (if the relevant Type was chosen earlier). Available choice options:

  • JSON
  • XML
  • Excel.

After loading data into the import source, saving the record and calling the one of the data loading actions, a new record appears in the Import Sets related list.

Also, several UI actions responsible for the further import processing appear on the import source form (see description below).

UI ActionDescription
Test load (20 records)

After clicking, a pilot import set is created with a 20-records capacity, intended for importing data structure analysis.

Do not use this set in further transform.

Load all records

This UI action creates new import set record with loading full data from import source there.

This import set can be used in further transform.

When calling record loading with one of UI actions listed below for the first time, a new table is created.

This table is in child relationships with the Import Set Rows table, and the table name is specified in the Import Set Table Name field of the source table.

Field system names of this table containing source data have the imp_ prefix in the name.

View transform mapThis UI action allows to view transform map for this specified import set. If no transform map is created, then you will be asked to create one.

After creating a first import set, create a related transform map. For this, please complete the steps below:

  1. Click on the View Transform Map UI action located on the import source form you are configuring.
  2. In the info message appeared, follow the link Create Transform Map.
  3. Fill in the fields in the form appeared.
  4. Click Save or Save and Exit to apply changes.

In this article below, you will get more information about transform maps.


For more information about LDAP import source, please refer to the Importing using LDAP article.

Using JSON format

You can use JSON files containing data formatted in JSON as a import source. In this case, make sure that these files follow the criteria below:

  1. JSON files should be valid. Use RFC 8259 as a guideline.
  2. Data types available to use in JSON structure are listed below. Dot-walking is not supported.


JSON Object
  {
    "top500": 1,
    "name": "More",
    "sector": "Oil and gas"
  }

Result: an import set with related table created (consisting of these fields: top500,name,sector) and containing one element.


Array of objects
[ 
 {
    "top500": 1,
    "name": "More",
    "sector": "Oil and gas"
  },
  {
    "top500": 2,
    "name": "Nevermore",
    "sector": "Oil and gas"
  }
]

Result: an import set with related table created (consisting of these fields: top500,name,sector) containing two elements.


Object with array of objects
// Path for Each Row == exportField
{
   "exportField":[
      {
         "top500":1,
         "name":"More",
         "sector":"Oil and gas"
      },
      {
         "top500":2,
         "name":"Nevermore",
         "sector":"Oil and gas"
      },
	  {
		"top500": 4,
		"name": "Givememore",
		"sector": "Oil and gas",
		"more_info": "https://instance.example.com/company/34"
	  }
   ]
}

Result: an import set with related table created (consisting of these fields: top500,name,sector, more_info) containing three elements.

Import Sets


Generally, an import set should be created automatically based on the raw data uploaded into the import source. Import sets are intended to be a staging area for records imported from the data sources.

Import Set field description

FieldMandatoryDescription
NumberY

Import set unique number. This field is populated automatically.

Import SourceY

This field contains related import source record number. This field is populated automatically.

Import Set TableY

This field contains related import set record number. This field is populated automatically.

StateY

Import set loading state. This field is populated automatically and always read-only.

Possible values are:

  • Loading – data loading into the import set is in progress.
  • Loaded – data loading into the import set has been finished.
  • Processed – the import set transform has been processed.
  • Cancelled – data loading has been cancelled.
Short DescriptionN

This field describes the structure of the table created and populated with the data automatically.

Field value example:

Table structure: (top500 | name | sector | more_info | created_at | created_by | record_id)

Transform Maps


Transform map is a set of field maps. In this set of field maps, the correlations between fields in an import set table and fields in a target table are specified.

Every import operation requires at least one transform map which specifies the relationships between the import set table and the target table.

To create a transform map, please complete the steps below:

  1. Click on the View Transform Map UI action located on the import source form you are configuring.
  2. In the info message appeared, follow the link Create Transform Map.
  3. Fill in the fields in the form appeared.
  4. Click Save or Save and Exit to apply changes.

A transform map can be also created "from scratch". For this, please complete the steps below:

  1. Navigate to Import → Transform Maps to open the transform maps list.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.


Transform Maps field description

FieldMandatoryDescription
NameYDisplayed transform map name.
ActiveNSelect this checkbox to make the transform map available to use.
Source TableYSelect the table containing the import set data.
Target TableYSelect the table where you want imported data to be placed.
Silent LoadNSelect this checkbox to ignore business rules, notification rules and other server-side engines which can be triggered by the record insert or update action.

Ignore Mandatory Fields

NSelect this checkbox to ignore mandatory fields on the target table.
Use ScriptN

Select this checkbox to display the Script field, where you can define the transform script.

If you unselect this checkbox after inserting a script, the script will not be applied within the transformation.

ScriptN

Insert a transform map script you want to use to transform field values.

This script can be used to define field relationships before transform. Also, these relationships can be configured by creating related records via the Field Map related list of the specified transform map.

If you are configuring field mapping with the script, then it is recommended to create one more allocated field map record to define the Coalesce settings for this transform session.

Transform map script

Transform map script allows you to customize import operations using a JS-scripts written using a SimpleOne Server-Side API

Transform Script field description

FieldMandatoryDescription
Transform MapYSpecify a transform map to which this script is related to.
ActiveNSelect this checkbox to make the script active or inactive.
WhenY

Specify the script type to occur:

  • onComplete – this script runs at the end of the transformation.
  • onStart – this script runs at the start of the transformation.
  • onAfter – this script runs after the source row is transformed into the target row.
  • onBefore – this script runs before the source row is transformed into the target row.
OrderN

This field specifies the order of transform scripts. Fill in this field with an integer number. Scripts will be sorted in the descending order.

ScriptNEnter the mail script using SimpleOne Server-Side API

Field Maps


Field maps are used to define correlation between fields in an import set table and fields in the target table by determining the values from the source table to be added to the target table.

Within the importing process, you may need to update existing records in the target table. To configure the key relationships between the Source Table and the Target Table, create at least one allocated field map record, with the Coalesce attribute turned on. This attribute should be activated for the field map containing relationships of the columns with unique values. It can be email for a user, or a serial number for a CI.

In order to achieve more strict mapping, you can activate the Coalesce option for more than one Field Map records.

To create a field map, please complete the steps below:

  1. Navigate to Import → Transform Maps.
  2. Open a transform map you want to configure.
  3. Click Create Field Maps UI action.
  4. The Field Maps widget appears (see screenshot in the table below).
  5. Configure field mapping within current transform process.
  6. Click Set to save changes or Cancel to discard changes.

There is another way to create field maps:

  • Navigate to Import → Transform Maps.
  • Open a transform map you want to configure.
  • In the Field Maps related list, click New, fill in the fields.
  • Click Save or Save and Exit to apply changes.
  • Repeat the previous step for each field map that needs to be set.

Field map fields description

FieldMandatoryDescription
Transform MapYDisplays the transform map using this field map. This field is populated automatically.
Source FieldYSelect the field of the source table to be transformed.
Target FieldYSelect the field of the target table where the values from the source table should be stored.

Coalesce

N

If this option is active within the transform process, then the engine checks for values in the Target table field whether they are equal to the Import set table field value. 

If values are equal, then the record in the Target table is updated; otherwise, a new record is created.

This option can be set up by the widget. After clicking a Create Field Maps UI action on the transform map form, a widget containing either Add coalesce or Drop coalesce buttons appear.

Use ScriptN

Select this checkbox to define the transform script in the Script field.

ScriptY

Insert a script to determine a function that takes the record object of the Import Set table as an argument and returns the value to put into the Target Field.

This field appears when the Use Script checkbox is selected.

Do not unselect the Use Script checkbox after inserting a script, otherwise it will not be applied.

Running a transform


  1. Navigate to Import → Import Sets.
  2. Open an import set you want to transform. Make sure that its state is Loaded.
  3. Click Transform.

  • No labels