Import from JSON File

The Import from JSON file allows users to import data directly from a JSON file.

The Import from JSON File task is divided into two tabs: the Options tab (please refer to the page Import Overview for more detailed information) and the Json Configuration tab, whose characteristics and configuration will be explained in the next section.


The JSON Configuration tab

The JSON Configuration tab is divided into three panes:

Parsing options

Within this pane, users can specify the features of the JSON file.

The following options are available:

  • Number separators: select the separators used for Thousands and Decimals from the corresponding drop-down lists.

  • Missing string: specify a character (or string of characters), which are used to indicate missing values in the source file.

  • Key for types: specify the string which identifies the type.

Import options

Within this pane, users can set the following options:

  • Skip wrong formatted rows (multi rows json): if selected, Rulex Factory reports an error if some rows are not correctly formatted.

  • Remove empty rows: if selected, empty rows are automatically deleted.

  • Add group columns: “if selected, an extra column is added containing the group id or the file structure.

  • Remove empty columns: if selected, empty columns are automatically deleted.

  • Add an attribute containing filename: if selected, a new column is added to the table with the name of the file.

  • Strip spaces: if selected, leading and trailing spaces are removed from the strings. For example, the string ” class ” is then imported as “class”.

  • Case sensitive: if selected, values with uppercase or lowercase values are considered as two different ones.

  • Compress white spaces: if selected, contiguous occurrences of white spaces are compressed in one single occurrence. For example the string “university program” would be imported as “university program”.

  • Turn off smart type recognition: if selected, the data types of attributes are not automatically recognized, leaving the generic nominal type. This option is useful when manual identification is preferable, for example when there is the risk of a code being misinterpreted as a date.

Table Preview

Within this pane, users will be able to visualize a preview of the imported file.

On the right of the Table preview pane, users can find the Number of records in preview box, which has a fixed value of 1,000, and can be edited.


Example

  • Drag an Import from JSON task onto the stage and select the file you want to import.

  • Configure the selected task as explained above in the sections above and link it to a Data Manager.

  • According to the selected JSON File, your Import from JSON task should look like the example provided below.

https://cdn.rulex.ai/docs/Factory/import-json_ex.webp