The JSON Dataview will prompt for information about the data that is to be extracted from or written to the JSON file, as specified on the initial screen through the File Connection.

Before you start creating your dataview, it is most important that you understand the structure of the JSON file that you will be working with. Essentially, JSON definitions are used to convert JSON text into a set of tables, and vice-versa.

The JSON dataview uses a single JSON Designer screen to capture all of the information that it needs.

image-20240505-235729.png

Once complete, click OK to save the details, generate a dataview, and return to the designer canvas.

Fields

Field Name

Description

Data View name

The Name of the dataview. This field is not forced to uppercase, and spaces will be treated as spaces.

Objects path

Specify the path, such as square brackets [] for a root array, or [].<dictionary>.{} for a sub-object path within a root array, or <array>[] for a named array.

Objects key field

The field that holds the key value for each object in this dataview. Also see Fields Path.

Create separate file for each record

Tick this box to create a file for every record. The default is to have this unticked.

Fields Name

The name within the dataview to be used for this field. It does not have to match the name of the object within the JSON file,

Type

The data type of this field. While there is no drop-down box to select from, type the first letter of the data type to populate.

For example, type S and the entry completes with the word String. Type I and it becomes Integer, type B for Boolean, or type F for the entry to become Float.

If this field is for the key value, then the data type should be Integer.

Size

The size of this field. Integer data type will default to zero ( 0 ).

Path

The name of the object in the JSON file.

This field is case sensitive. If the object is called group in the JSON file, then it must be identified as group here - if it is entered here as Group it will not be included.

If this is the key value for the sub-object, then the path will be the word key.

Default

The default value for the field.

Buttons

Button Name

Description

Fields Add

Add a new field to the list.

Delete

Delete the current field from the list.

image-20240506-003411.png UP Arrow

Move the current selected field up the list order.

image-20240506-003537.png DOWN Arrow

Move the current selected field down the list order.

OK

Click to save any changes you have made. All changes will be lost if you do not click the OK button.

Cancel

Click to Cancel any changes you have made.

The following example shows a small simple JSON file, containing details of several types of flower.

The BLUE indicates the start/end dictionary pair of curly braces { }, enveloping the entire code.

The RED indicates the start/end of the named JSON array called Flowers, identified by the presence of the square brackets [ ].

The GREEN indicates the initial iterating dictionary shown by the curly braces { } within the JSON object array.

image-20240507-011638.png

This JSON file is referenced in the JSON definition as below.

image-20240507-011019.png

This results in the following dataview and Preview.

image-20240507-013053.pngimage-20240507-013209.png

Note that where the fields are not present for a particular iterating dictionary object, the field is left blank in the dataview.