Export to JSON File

The Export to JSON File task allows users to export datasets or other data structures to a JSON file.

The Export to Excel task is divided into two tabs:


The Options tab

A detailed description of the Options tab is provided in the Export tasks introductory page.

Specific options are available when exporting to an Http Server destination type, more information available at the corresponding page.


The Export Options tab

The Export Options tab contains the Dataset structure pane, the JSON API Schema area, and the Import options pane.

Dataset structure

The following options are available in this pane:

  • File format: the format of the JSON file to be created. Possible values are:
    • flat (default)

    • nested

    • group

    • JSON schema

  • Key for types: the string identifying the type.

  • Remove missing value: if selected, missing records are removed from the exported file.

  • 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.

  • JSON API Schema: see the paragraph below to know more about it.

JSON API Schema

The JSON API Schema area, located at the bottom of the Export Options tab, is a section which allows users to visualize either how the JSON keys and values will be located in the file, or a preview of the file which will be exported. It is possible to visualize the data both in code and preview formats, by clicking on the button located in the top-right corner of the JSON API Schema panel.

As the data to export is received in a tabular format in the task, in the code mode Rulex Factory provides a schema, opened by default in the JSON API Schema panel, which helps users understanding how the body of the API request will be structured in JSON format, and to edit it.

Parametrized keys are the attributes’ headers, so they are written as follows: $"parametrized_key", as they indicate the attribute name or the attribute’s values which will fill the corresponding key.

In the preview mode, users will be able to visualize a full preview of the file, and of how it will be filled with values.

The JSON schema in preview mode cannot be edited, no matter which permissions the user has.

Import options

Available in the Export to JSON File and in the Export to XML File tasks only, the Import options pane is located under the Json API Schema pane, and it is activated if the Response as output dataset option has been selected.

The pane’s name is due to the fact that the task imports the API response, so that the response can be the task’s output.

Here, the layout of the tasks’ output will be defined.

It contains some options of the customization pane in import tasks, listed here.


Example

  • Drag an Export to JSON File task onto the stage and link it to the task containing the data to export.

  • Double-click the task to open it and configure it as follows:
    • Select Dataset as the Data to be exported.

    • Select Store file as the Export mode.

    • Select the Destination type: in this case, we decided to use a Saved resource, a Sharepoint folder.

    • Once the folder has been selected by clicking on Select and choosing the path, write the File basename in the corresponding field and the Sheet name.

  • Save and compute the task.

https://cdn.rulex.ai/docs/Factory/export-json.webp