Up - API Reference - Home
Metadata can be attached to definitions, classes, and fields. The metadata is user-definable - you define a name, type, and value, and if the value should be localized or not. Your value should match the type, otherwise it is converted to the type on a best-effort basis.
The metadata looks like this, for example for a 'width__mm' field:
{
"heading.abbreviation": {
"type": "textline",
"is_localized": true,
"value": {"en": "w [mm]", "nl": "b [mm]"}
},
"heading.icon": {
"type": "image",
"is_localized": false,
"value": "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74"
}
}
Metadata is grouped, and this grouping is based on the dots in the name. At least one dot is required, more are allowed. For the rest of the name, regular field-naming rules apply (just letters, numbers, and underscores, don't start with a number).
For localized values, these are always a dict with the languages as keys, and a value for each language - that value must match the type.
text
generic text, line breaks are allowed
textline
a single line of text
textlist
multiple lines of text, each line has a similar meaning - think bullet points
number
an integer number
decimal
a fractional number
boolean
a toggle, yes/no value
image
a reference to an image asset, for example an icon
fieldpicker
a reference to a field, for example to define which class fields to show in the webshop filtering
When a referenced image or field is deleted, the metadata entry gets set to null
(by a worker in the background, so not immediately).