Import from JSON File#

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

The Import from JSON File task is divided into two tabs:


The Options tab#

The Options tab follows the structure shown in the Import Overview page.

In this task only, the following option is present, too:

  • Repeat REST API call until claim: specify the claim name, the operation from the drop-down list and the value which must be present to repeat the API call.


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.

  • Next link claim: specify the key containing the link required to retrieve the next rows, in case of large tables. This way, Rulex Factory will import the complete table.

  • Save response header: available in the Import from JSON File and in the Import from XML File tasks when importing from a Http Server, allows to save the response’s headers, by adding two extra columns to the dataset: one containing the headers’ names, and another one containing the headers’ values, so that each row contains the header name and its corresponding value.


Example#

  • Drag an Import from JSON File task onto the stage.

  • Double-click to open the task.

  • Select Custom from the Source slider.

  • Select Local File System from the drop-down menu.

  • Click Select and browse to the JSON file you want to import.

  • Configure the selected task as explained above in the sections above.

  • Click Load Preview to visualize a preview of your imported table in the Table preview pane.

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

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