The Import engine allows administrators to collect data from various data sources and then map this data into relevant tables.
The SimpleOne import engine supports:
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 to the target table.
Role required: admin. |
You can find a graphical procedure view of the import process in the diagram below. A more detailed description is provided further in this article.
|
Key concepts
Concept | Description |
---|---|
Import source | A record that specifies what data an import set should import. |
Import set | A record that contains references to raw data uploaded to the staging location. The record also returns information about this import attempt state. |
Import set table | An automatically generated table that is used as the temporary storage for imported records before transformation. The structure of the table is automatically generated depending on the imported data. |
Transform | The process of converting data according to the transform map and transform scripts that define the source table (the import set) and the target table. |
Transform map | In this set of field maps, a record that specifies correlations between fields in an import set table and fields in a target table. |
Transform script | A script that allows for customizing import operations using native JavaScript extended with SimpleOne Server-Side API. |
Field map | A record that specifies the relationship between a field in an import set table and a field in a target table. |
Coalesce | This option allows you to update existing table records within the transformation process. For more information, navigate to the relevant article part: Coalesce. |
Creating an import source is necessary to load raw data into the system for further processing and transformation. You can set up an import source with different data source types and file formats.
If the File type is selected, click the attachment icon and attach the file you need.
You can attach JSON, XML, or Excel files. |
Import Source form fields
Field | Mandatory | Description | |
---|---|---|---|
Name | Y | Specify the import source name. | |
Import Set Table Name | Y | Specify the import set table name. | |
Type | N | Choose the type of import source. Available choice options:
| |
File Retrieval Method | N | Choose the method to add the file to the import source. Available choice options:
This field appears if the File type is selected. | |
Format | Y | Select the file format and attach it to the form. Available file format options:
This field appears if the File or Text type is selected. | |
Import Text | N | Specify the text you need to import. This field appears if the Text type is selected.
| |
LDAP Definition | N | Click the magnifier icon
|
After saving, the following UI actions appear on the import source form. They are responsible for further import processing.
Action | Description | |
---|---|---|
Test load (20 records) | After clicking, a pilot import set is created with a 20-records capacity, intended for importing data structure analysis.
| |
Load all records | This action creates a new import set record by loading full data from the import source there. This import set can be used for further transformation. |
After loading data into the import source, saving the record and calling one of the data loading actions, a new record appears in the Import Sets related list.
You can use files containing data formatted in JSON as an import source. In this case, make sure that the files follow the criteria below:
{ "top500": 1, "name": "More", "sector": "Oil and gas" } |
Result: one element. The table has top500, name, sector fields and contains one record.
[ { "top500": 1, "name": "More", "sector": "Oil and gas" }, { "top500": 2, "name": "Nevermore", "sector": "Oil and gas" } ] |
Result: an import set with the related table is created. The table has top500, name, sector fields and contains two records.
// 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 the related table is created. The table has top500, name, sector fields and contains three records.
When converting data for import, some changes occur to the system names of columns and tables that appear in the Import Set Table Name field of the Import Sources (sys_import) table. Namely, the names are transliterated and converted according to the following rules:
/[^A-Za-z0-9_]+/u
are substituted with an underscore _ symbol. That is, all symbols except capital and lowercase letters, digits, and the underscore are substituted with _ .The current system name of the column is transformed to lowercase.
If a column name is empty, then, when converting, the system sets the following name |
imp_client_list
.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 form fields
Field | Mandatory | Description | |
---|---|---|---|
Number | N | Import set unique number. The field is populated automatically. | |
Import Source | Y | The field contains related import source name. The field is populated automatically. | |
Import Set Table | Y | The field contains the related import set table name. The field is populated automatically.
| |
State | N | Import set loading state. The field is populated automatically and is always read-only. Possible values are:
| |
Short Description | N | The field describes the structure of the table created and is populated with the data automatically. Field value example:
|
Import Set records are in the parent-child relationship with the Import Set Rows table records.
A transform map is a set of field maps. In this set of field maps, correlations between fields of the import set table and fields of the target table are specified.
Each import operation requires at least one transform map that specifies the relationship between the import set table and the target table.
After creating the first import set, create a related transform map. To do this, complete the steps below:
A transform map can also be created from scratch. To do this, complete the steps below:
|
Transform Map form fields
Field | Mandatory | Description | |
---|---|---|---|
Name | Y | Specify a displayed transform map name. | |
Active | N | Select this checkbox to make the transform map available for use. | |
Source Table | Y | Select the table containing the import set data. | |
Target Table | Y | Select the table where you need to place imported data. | |
Silent Load | N | Select the checkbox to ignore business rules, notification rules and other server-side engines that can be triggered by the insert or update actions. In particular, workflows related to this record will not start, the field changes history will not be recorded and will not be displayed in the Activity Feed, respectively. You can find engine and business rule execution orders in the Execution order article. | |
Ignore Mandatory Fields | N | Select the checkbox to ignore mandatory fields in the target table. | |
Use Script | N | Select the checkbox to display the Script field, where you can define the transform script.
| |
Script | N | Insert the transform map script you need to use to transform field values from the source table to the target table. To learn more about the advanced import, refer to Developer API articles. |
Field maps are used to define the correlation between fields of the import set table and fields of the target table. For this, you need to determine the values from the source table that will be added to the target table.
During the import process, you may need to update the existing records in the target table. To set up the key relationships between the Source Table and the Target Table, create at least one field map record, with the Coalesce attribute enabled. This attribute should be enabled for a field map that contains relationships of columns with unique values. It can be an email for a user or a serial number for a CI. To achieve stricter mapping, you can enable the Coalesce option for more than one Field Map record. |
To create a field map, complete the steps below:
Here is another way to create field maps:
|
Field Map form fields
Field | Mandatory | Description | |
---|---|---|---|
Transform Map | Y | Displays the transform map using this field map. The field is populated automatically if the record is created via the related list or the Field Map widget. | |
Source Field | Y | Select the field of the source table that should be transformed. | |
Target Field | Y | Select the field of the target table that should store the values from the source table. | |
| N | If this option is active within the transformation process, the engine checks whether values in the Target Table are equal to values in the Import Set table. If values are equal, the record in the Target Table will be updated; otherwise, a new record will be created.
| |
Use Script | N | Select the checkbox to define the transform script in the Script field. | |
Script | Y | 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. The field appears when the Use Script checkbox is selected.
To learn more about advanced import, refer to Developer API acrticles. |
As a result, the message Import is completed
appears. Imported data will be transferred into the target table.