ShtukbaseStandard
package page→ /base/fields.md

pages/base/fields.md

25 lines, 2.1 KB. As a page.

  1. ---
  2. type: Page
  3. title: "Kinds of fields"
  4. icon: "🏷️"
  5. description: "Which fields the records of a collection can have: the kind of field, what it holds, how it is described in the schema and what is checked."
  6. ---
  7. A record field is described in the collection schema, in `properties:` of its page: the field name, its kind (`kind`), the label (`label`) and the parameters of the kind. Any field can have `required: true` (always filled) and `requiredWhen: {field: [values]}` (filled when another field, usually the state, takes one of the values).
  8. | Kind | What is in the field | Parameters in the schema | What is checked |
  9. |---|---|---|---|
  10. | `text` | free text | none | only requiredness |
  11. | `select` | one value from a list | `options: [{name, label, color}]`; `multiple: true` for several values | the value is among `options` (SCH-R02) |
  12. | `relation` | the path of a record of another collection, for example `/work/initiatives/i-01` | `collection`: where it points; `multiple: true` for several paths | the record exists and lies in this collection (SCH-R01) |
  13. | `phase` | the state of a record: the name of a contour phase | `contour`: the path of the contour | package `contours`: the value is a phase of this contour |
  14. | `date` | a date | none | the form `YYYY-MM-DD` (SCH-R02) |
  15. | `number` | a number | none | a number (SCH-R02) |
  16. | `checkbox` | a checkbox | none | `true` or `false` (SCH-R02) |
  17. | `rollup` | a rollup: the number of records of another collection that refer to this one | `from`: the collection, `via`: the relation field in it, `measure: count` | computed, not written by hand |
  18. | `url` | an address in the outside world | none | only requiredness |
  19. | `files` | attached files | none | only requiredness |
  20. A relation is written in the lower record and points up; each relation has one stored direction. Back links are computed (a rollup) and are not created by hand. A link in the text of a page does not count as a relation.
  21. An empty value (no field, an empty string, an empty list) is skipped by the value check: emptiness is caught only by requiredness (SCH-R03).