The mapping object for JSON is specified as the first element of the JSON array. This object is used for setting data types, creating multilevel hierarchies, and changing captions.
Name | Type | Description |
---|---|---|
type | String | optional The field’s data type. Possible values:
|
caption | String | optional The field’s caption. |
hierarchy | String | optional The name of the hierarchy. Used for multilevel hierarchies. Set this property to make the field a level of the specified hierarchy. In this case, the type must be set to "level" . |
parent | String | optional The caption of the parent hierarchy level. Used for multilevel hierarchies. In this case, the type must be set to "level" . |
level | String | optional The caption of the hierarchy level. Used for multilevel hierarchies. In this case, the type must be set to "level" . |
1) Setting the mapping object in a JSON array of objects:
[ { "Product": { "type": "string" }, "Price": { "type": "number" } }, { "Product": "Apple", "Price": 2.50 }, { "Product": "Cherry", "Price": 5.25 } ]
See the full example on CodePen.
2) Setting the mapping object in a JSON array of arrays:
[ { "Product": { "type": "string" }, "Price": { "type": "number" }, }, ["Apple", 2.50], ["Cherry", 5.25] ]
Try a live demo on CodePen.