# Field

The order on the schema.fields array will define the order of the fields, namely on the interface.

  • mandatory: Defines if the field is mandatory or not (0 | 1).

  • minChars: Define the minimum of characters for the field. This can be used of the following field types:

    • text

    • number


  • maxChars: Define the maximum characters for the field. This can be used of the following field types:

    • text

    • number


  • readOnly

Allows to define the field as read only (0 | 1 | 2). 1 means read only after the insert, 2 means read only always (are only processed server-side).

Can also have the special values 3 and 4, that are similar to 1 and 2 but allow API processment.

This can be applied to all fields with the exception of the type "subschema".


  • defaultValue: Defines a default value for the object at his creation. This can be a string, number or some special words.

    • NOW this can be used on "datetime" types and will define the current date and time.
    • user.tenant_id tenant_id is just an example, in fact any valid field of the schema user can be used.
    • YEAR output the current year (4 digits) can be usefull and meaningfull using on text, number or hidden types.
    • RANDOM_KEY will create a random string with 12 bytes (24 chars).
    • MAX will set the max priority value for the table (applies only to priority field).

These are all processed server side. The NOW is also processed client side, to allow quicker selection of the current date and time.


  • active

Ranges from 0 to 1, if 0 the field is ignored.


  • list_width

Ranges from 0 to 100, it defines the width in percentage of the field on a list representation. The sum of the fields of a schema should never be bigger than 100.


  • filter

JSON string that allows a definition of an array of filters. This is used only on the UI level and will create a filter on the list template. For each filter we define the name and the operator (op), that can be any logical operator (<, <=, >, >=, =, <>) or the SQL LIKE operator.

[
  {
    "name": "Texto",
    "op": "LIKE"
  }
]

  • panel: It's an integer that represents the "id" of the panel (a panel is a tab on the UI). Panels are created at the Schema level. If no panel is defined this field should be null or empty.

  • gui: This property will allow to define the width and a margin-right value for the UI representation of the field, allowing to draw grid forms. Normally the values are in percentage to create a responsive layout. Since the UI uses flexbox the marginR property can be used to fill with spaces on the rest of the line.
{
  "width": "50%",
  "marginR": "50%"
}

It's also available sugar sintax that can be used directly into the root of the field definition.

{
  "width": "50%"
}

  • multilang: Ranges from 0 to 1. When true this means the field as a multi-language representation.

  • override: This property allows to override almost any of the other properties based on profile names. This means that we can have different field configurations for each profile.

The following properties can be override: active, gui, listWidth, readOnly, mandatory, label and filter.

{
  "superadmin": {
    "active": 0
  },
  "admin": {
    "readOnly": 1,
    "mandatory": 0
  }
}
Last Updated: 11/16/2024, 12:12:27 AM