Field
Field

Insert a single field value of a model object inline.

Field inserts a single field value of an object into the middle of a sentence. When the field is missing or empty, the fallback value is used (if provided).

Supported props

PropTypeRequiredDefaultPurpose
model_keystringyes*current route modelWhich model the object belongs to
objectstringyes*Object id, relative to the model
namestringnoField to read (omit for primitive items)
fallbackstringnoemptyShown when the field is missing/empty

* Inside Each, ObjectList, or ObjectTable the current iteration item is used, so object and model_key are not required.

Example

PostgreSQL type: <Field model_key="deployment" object="iomodel.postgres" name="type" fallback="unknown" />

Rendered: PostgreSQL type: unknown

Primitive items

When iterating with Each over="tags", each item is a primitive — read it with name="value":

<Each model_key="deployment" object="iomodel.studio" over="tags">

<Field name="value" />

</Each>

Common pitfalls

  • Reading a field that does not exist returns empty — use fallback for a default
  • For arrays (e.g. tags) the value is rendered comma-separated

Last updated on