Embedded JSON metadata
Embedded JSON metadata is an object in JSON data that allows defining how each field must be presented in the component.
Note Values in the JSON metadata are overridden by values defined in the mapping or in the server’s schema.
Supported metadata properties
Name | Description |
---|---|
captionString | optionalSpecifies the field's caption that will be displayed everywhere in the component’s UI. If the caption is not specified, it is the same as the field’s unique name. Learn more about setting field captions. |
typeString | optionalSpecifies the field's data type. If the type is not specified, the field's data type is resolved automatically. Learn more about specifying field types. |
nameString | optionalOnly for a JSON array of arrays. Specifies the field's unique name. The component uses the name value to identify the field in the dataset. If you skip the name property, the component will autogenerate field names. Learn more about field unique names in JSON array of arrays. |
How to specify JSON metadata
Embedded JSON metadata is specified as an object with metadata properties. The place where the metadata is specified depends on how you define your JSON dataset:
Setting field unique names for the array of arrays format
If you are using the embedded metadata for the array of arrays format, Flexmonster will autogenerate field unique names unless the name annotation is specified. For example:
[
[
{ "type": "integer" },
{ "type": "string" },
{ "type": "date" }
],
[100, "Headphones", "2025-04-12"]
]
In this case, field unique names will be field 0
, field 1
, and field 2
`.
To set custom unique names, specify them in the name metadata annotation:
[
[
{ "name": "Price", "type": "integer" },
{ "name": "Item", "type": "string" },
{ "name": "Order Date", "type": "date" }
],
[100, "Headphones", "2025-04-12"]
]
Now the unique names will be Price
, Country
, and Order Date
.