Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merged branch "DOC0000301" into parent

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 followingsupports:

  • different data sources source 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 to the target tablestable.

Tip

Role required: export_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.Image Removed

Section


Column
width33%

    


Column
width33%

Image Added


Column
width33%

    



Anchor
Key Terms
Key Terms
Key

terms

concepts

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

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

Import set table

An automatically generated table that is 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 process of converting 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 a record that specifies correlations between fields in an import set table and fields in a target table are specified.

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

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

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

General import procedure description

Prepare raw data

.

  • Create an import source.
  • Load raw data into the import set table.
  • Create a transform map.
  • Create field maps.
  • Run a transform.
  • Verify results.
  • Tip

    Role required: export_admin.

    Anchor
    Import Sources
    Import Sources
    Import Sources


    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 able to work with the different data source types and file and file formats.

    LDAP DefinitionNClick on the magnifier icon Image Removedto choose the protocol you need. This field appears if the LDAP type is chosen
    1. Navigate to Import → Import Sources.
    2. Click New and fill in the fields.
    3. If the File type is chosen, click on the attachment icon   and attach the file you need.

      Tooltip
      onlyIcontrue
      appendIconinfo-filled
      iconColorblue

      You can attach JSON, XML or Excel files. 


    4. Click Save or Save and Exit to apply changes.
    FieldMandatoryDescriptionNameYDisplayed import source name.Import Set Table NameYImport set table name.

    Type

    N

    Type of the import source. Available choice options:

    File Retrieval MethodN

    Choose the method of the file adding to the import source. Available choice options:

    • Attachment.

    This field appears if the File type is chosen.

    FormatY

    Select the file format and attach it to the form. Available file format options:

    • JSON
    • XML
    • Excel.

    This field appears if the File type is chosen.

    Import TextNSpecify the text you need to import. This field appears if the Text type is chosen. 
    1. .
     

    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.

    Note

    Do not use

    this

    the test set

    in

    for further

    transform

    transformation.


    Load all records

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

    This import set can be used in for further transformtransformation.

    Info

    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.

    Create field mapThis UI action calls a widget of a field map for this specified import set. Here you can define relations between fields. If no field map is created, then you will be asked to create one.
    Note

    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.

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

    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. 

    Using JSON format


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

    1. JSON files should be valid. Use Use the RFC 8259  document as a guideline.
    2. Data types available to use in JSON structure are listed below. Dot-walking is not supported.
    Code Block
    languagejs
    themeEclipse
    titleJSON Object
    linenumberstrue
      {
        "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 elementone element. The table has top500, name, sector fields and contains one record.

    Code Block
    languagejs
    themeEclipse
    titleArray of objects
    linenumberstrue
    [ 
     {
        "top500": 1,
        "name": "More",
        "sector": "Oil and gas"
      },
      {
        "top500": 2,
        "name": "Nevermore",
        "sector": "Oil and gas"
      }
    ]

    Result: an import set with the related table created (consisting of these fields: is created. The table has top500, name, sector) containing two elements fields and contains two records.

    Code Block
    languagejs
    themeEclipse
    titleObject with array of objects
    linenumberstrue
    // 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 created (consisting of these fields: is created. The table has top500, name, sector, more_info) containing three elements fields and contains three records.

    Anchor
    Import Sets
    Import Sets
    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

    FieldMandatoryDescriptionNumberY

    Import set unique number. This field is populated automatically.

    Import SourceYThis 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 DescriptionNThis field describes the structure of the table created and populated with the data automatically.

    Field value example:

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


    Anchor
    Transform Maps
    Transform Maps
    Transform Maps


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

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

    To After creating the first import set, create a related transform map. To do 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 appeared toast message appeared, follow the link Create Transform Map.
    3. Fill in the fields in the appeared form appeared.
    4. Click Save or Save and Exit to apply changes.
    Tip

    A transform map can also be also created "from scratch". For To do 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

    FieldMandatoryDescriptionNameYDisplayed 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 LoadN

    Select this checkbox to ignore business rules, notification rules and other server-side engines which can be triggered by insert or update actions. In particular, workflows related to this record will not start, the field changes history will not be recorded and not displayed in the Activity Feed, respectively.

    Info

    When updating records automatically with scripts, you may also need use the Silent Load features. In this case, use the silentMode method.

    You can find engines and business rules execution order in the Execution order article.

    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.

    Note

    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 Scripts


    Transform

    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

    FieldMandatoryDescriptionTransform 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.
    OrderNThis field specifies the order of transform

    scripts

    . Fill in this field ScriptNEnter the mail script using

    with

    an integer number. Scripts will be sorted in the descending order.

    SimpleOne Server-Side API

    Anchor
    Field Maps
    Field Maps
    Field Maps


    Field maps are used to define correlation between fields in an the correlation between fields of the import set table and fields in of the target table by determining . For this, you need to determine the values from the source table to that will be added to the target table.

    Info

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

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

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

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

    There Here is another way to create field maps:

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

    Field map fields description

    FieldMandatoryDescriptionTransform 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. AnchorCoalesceCoalesceCoalesceN

    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.

    Tip

    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.

    Image Removed

    Use ScriptN

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

    ScriptYInsert a script to determine a function that

    Map form fields 

    Running a transform


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

    As a result, the toast message Import is completed appears. Imported data will be transferred into the target table.

    Transform sequence


    The scheme below shows the sequence of events triggered by the transformation: 

    Image Added

    1. The sequence begins with the onStarttransform script. It will be executed at the start of the transformation before any source row is read.
    2. The field map script takes the record object of the Import Set Row table as an argument and returns the value to put
    into
    1. into the Target Field.

    This field appears when the Use Script checkbox is selected.

    Note

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

    1. The transform map script transforms field values from the source row to the target row.
    2. The onBefore transform script is executed before the source row is transformed into the target row. 
    3. Between the execution of onBefore and onAfter scripts, the target record is inserted or updated.
    4. The onAfter transform script runs when the source row has been transformed into the target row.
    5. The onComplete transform script is executed when all source rows are transformed.
    Info

    The onBefore and onAfter scripts are repeatable, they will run until each record is transformed. 

    Running a transform

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


    Table of Contents
    absoluteUrltrue
    classfixedPosition