Concepts

Fields and types

The field catalogue: system names, display names and the seven field types.

Every value an entity holds is a field from the global field catalogue. Perspectives choose fields from the catalogue; they don't define their own.

What a field has

PropertyExampleNotes
System namecreditLimitThe JSON key that's stored. Unique ignoring case, so email and Email can't both exist. Can't start with _.
Display nameCredit LimitWhat forms and views show.
TypeDecimalOne of the seven types below. It can't change once the field is defined.
DescriptionOptional help text.

Types

TypeJSON valueIn queries
TextstringCompared ignoring case. ~= (contains) works only on Text.
Integernumber (64-bit integer)
Decimalnumber
Booleantrue / falseOnly = and !=.
DateTimeISO 8601 stringCompared as instants; a value without an offset is treated as UTC.
ReferenceGUID stringThe id of another entity. Only = and !=. Relationships use Reference fields.
Jsonany JSON valueNot type-checked, and can't be indexed.

More detail, including how each type is indexed and sorted, is in Field types.

Where a field is used

A field can be in any number of perspectives. GET /api/schema/fields/{name}/interfaces lists them: those are the places a value will also appear. This matters for security too: a perspective's manager can't add a field that another perspective they don't manage already uses, since that would show its values to their readers. See Roles and permissions.

Defining fields

  • On the maker site: Fields → New field….
  • With occtl: occtl schema field set creditLimit --type Decimal --display-name "Credit Limit".
  • With the API: PUT /api/schema/fields/creditLimit with { "displayName": "Credit Limit", "type": "Decimal" }.
  • In a plugin's manifest, which adds its schema when the plugin is installed.