You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

Modules

A module stores and shapes your data (records) for a given namespace. The data from namespace A can not be referenced by namespace B.

Relational database correlation:
  • module ~= table

  • module field ~= attribute

  • record ~= entity

Corteza Low Code supports multi-value fields, which removes the need of simple pivot tables.

When exporting multi-value fields into the CSV format, only the first value is exported.

Module definition guidelines

Module name

The module name should be in PascalCase with spaces allowed, it should be short and descriptive, with no special characters except for : (colon), - (dash), _ (underscore), / (forward slash) and \ (backwards slash).

Module handle

The module handle should be in snake_case, it should be short and descriptive, with no special characters.

The provided handle must:
  1. start with a character,

  2. contain only characters, numbers, _ (underscore), - (dash) or . (dot),

  3. end with a character or a number.

Module field definition guidelines

Field name

The module field name should be in snake_case, it should be short and descriptive, with no special characters.

The provided name must:
  1. start with a character,

  2. contain only characters, numbers, _ (underscore), - (dash) or . (dot),

  3. end with a character or a number.

Field title

The maximum module field title length is 64 characters. There are no other restrictions.

Type

The module field type defines the type of the stored data. Make sure to use appropriate types.

Create a module

To create a new module:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. enter the module name and press the "Create" button,

  5. provide the module handle and save the changes.

You can only define permissions for existing modules.

Importing modules

The current module importing system is unable to resolve relations between different modules via record fields. References must be fixed manually after the system finishes with the import.

Currently, only the JSON format is supported.

To import modules:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. find the "Import module(s)" section on the top of the page,

  5. click on the "Browse" button and select the JSON file containing module definitions,

  6. click on the "Import" button,

  7. select on the modules you wish to import and press the "Import" button.

Editing a module

To edit an existing module:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. click on the edit icon next to the module you wish to edit,

  5. update the data and save the changes.

Deleting a module

To delete an existing module:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. click on the edit icon next to the module you wish to edit,

  5. click on the "Delete" button on the bottom of the page and confirm the action.

Adding module fields

To add a new module field:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. click on the edit icon next to the module you wish to edit,

  5. click on the "+ Add new field" button,

  6. configure the field as you see fit and save the changes (see module field properties).

Editing module fields

If the module contains records, the editing interface is limited. If you wish to change the disabled properties, we suggest you create a new field instead.

To edit an existing field:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. click on the edit icon next to the module you wish to edit,

  5. configure the field as you see fit and save the changes (see module field properties).

Deleting a module field

When deleting existing fields, the change will not take effect unless you explicitly save the changes.

When deleting new fields, the changes take effect immediately.

To delete an existing field:
  1. navigate to the Corteza Low Code page and enter the namespace you wish to edit,

  2. click on the "Admin panel" in the top right corner,

  3. navigate to the "Modules" subpage,

  4. click on the edit icon next to the module you wish to edit,

  5. click on the trashcan icon next to the field you wish to delete and save the changes.

Module field properties

Name

The name for the field defines how the values are stored. If you don’t provide a title, the field name is used as the title.

The provided name must:
  1. start with a character,

  2. contain only characters, numbers, _ (underscore), - (dash) or . (dot),

  3. end with a character or a number.

Title

A human-friendly field title shown when interacting with the data. It should be short, descriptive and limited to 64 characters. No other restrictions apply.

Type

The module field type defines the type of the stored data. Make sure to use the appropriate type.

Multi value

Multi value fields allow you to store multiple entries under the same field. This removes the need for simple pivot tables.

When exporting multi-value fields into the CSV format, only the first value is exported.

Required

The required flag makes the field mandatory for the end-user when creating or editing a record.

Private

The private flag marks the data as sensitive; such as name, email, or telephone number. This helps make your namespace compliant with privacy regulations, such as GDPR.

Module field types

Access additional configuration options, by pressing on the wrench icon next to the field type.

Checkbox (Y/N)

The checkbox field type represents a true/false (yes/no) value; a boolean. When editing, the field is a checkbox; when viewing, it’s the value label.

Additional configurations:
  • true/false label: the label to show when the value is true or false.

Date and time

The date and time field type represents a temporal value (date and/or time); a timestamp. When editing, the field is a date-time picker; when viewing, it’s a text string.

Additional configurations:
  • date only: omit the time part and only use the date,

  • time only: omit the date part and only use the time,

  • past values only: only allow past values,

  • future value only: only allow future values,

  • output relative value: show the value relative to now,

  • custom output format: custom output date format.

See Moment.js format for available date-time formatting.

Email

The email field type represents an email address (the field has some built-in value validation). When editing, the field is an email input box; when viewing, it’s either a link or a text string.

Additional configurations:
  • don’t turn email into a link: keep the link as plain text.

The email is stored as plain text regardless of the configuration options. The email is converted to a link before it is shown on the user interface.

Select / dropdown

The select / dropdown field type represents a text value that is limited to the specified set of options. When editing, the field is a native dropdown; when viewing, it’s a text string.

Additional configurations:
  • Options: a set of label/value pairs of the available options. The value part defines how the data is stored internally; the label part describes how the data is presented to the user (defaults to the value).

  • Multiple value input type: specify how multiple values are selected.

Number

The number field type represents a numerical value. When editing, the field is a number input; when viewing, it’s a formatted text string.

The same field can store both full and fractional numbers.

Additional configurations:
  • prefix: specify the prefix, such as $,

  • suffix: specify the suffix, such as USD/h,

  • precision: specify the number precision (maximum is 6),

  • format: specify the display format.

See Numeral.js format for available number formatting.

Record

The record field type represents a reference to another record. When editing, the field is a searchable dropdown select field; when editing, it’s a clickable link.

You can only reference records in the same namespace.

Additional configurations:
  • module: specify what module this field will be linked to,

  • record label field: specify what field should be used when showing the linked record,

  • query fields on search: specify the fields that should be included in the search,

  • pre-filter records: specify the pre-filtering.

String

The string field type represents a text string value. When editing, the fields are either regular text input or a rich-text input; when viewing, it’s a formatted text string.

Additional configurations:
  • multi-line: specify that the value can span over multiple lines,

  • use rich text editor: use the rich text editor instead of the simple plain text editor.

URL

The URL field type represents a URL value (the field has some built-in value validation). When editing, the field is an URL input box; when viewing, it’s either a link or a text string.

Additional configurations:
  • trim # from the URL: specify that the fragment should be ignored (the thing after the #),

  • trim ? from the URL: specify that the query should be ignored (the thing after the ?),

  • only allow SSL (HTTPS) URLs: specify that only secure URL’s can be provided,

  • don’t turn URL into a link: keep the URL as a plain text value.

The above configurations can help you sanitize user input with no additional code required.

The URL is stored as plain text regardless of the configuration options. The URL is converted to a link before it is shown on the user interface.

User

The user field type represents a reference to a user. When editing, the field is a searchable dropdown; when viewing its a text string (the registered name).

Additional configurations:
  • preset with current user: default to the user that created/updated the record,

  • multiple value input type: determine how multiple values are selected.

File upload

The file field type represents a reference to a file uploaded to the record. When editing, the field is a file uploader; when viewing, it’s one of the configured displays.

Additional configurations:
  • view mode: specify how the files are presented when viewing the value.

Module field expressions

Module field expressions let you define value expressions (formula fields), custom sanitizers, and custom validators.

Use value expressions instead of automation scripts when you need simple calculations. It is much faster and simpler to maintain.

Value expressions

Value expressions calculate the field value based on the rest of the field values.

Currently, you can only use values of the current record. References are not yet supported.

If the value expression evaluation results in an error, the errors are appended to the field error set (in the web application they are shown under the field).

Use the custom validators for value validation.

If your field is a multi-value field, you need to return an array of items.

Available variables in the evaluation context:
  • old: record object with old values (empty when creating).

  • new: record object with current field values.

  • <field-name>: a string or array of strings with current field values.

If field name collides with (they have the same name) any of reserved variables you can access them via old.values.<field-name>.

Example expression that calculates the price with tax:
price * 1.25
Example expression that generates a full name:
trim(firstName + " " + lastName)
Example of a multi-value expression evaluation:
["foo", "bar", "baz"]

Sanitizers

Sanitizers modify the field value to cleanup (sanitize) the data before it is saved.

If the sanitizer evaluation results in an error, the error is logged in the action log.

If you define multiple sanitizers, they are run in the defined order.

Example sanitizer that limits the text length:
length(value) > 5 ? substr(value, 0, 5) + "..." : value
Available variables in the evaluation context:
  • value: the current field value.

Validators

Validators validate the field value by raising errors when the value is not valid. Validators can not change the value.

Built-in field validators can be disabled; required and unique-multi-value validators can not be disabled.

If you define multiple validators, they are run in the defined order.

The field validation step errors out when first error occurs.

If we define validators A, B, and C, and the validator A raises an error; validators B and C are not evaluated.

Validation expressions are not executed when:
  • the value is not changed,

  • the value is missing.

Use the required flag to check for required values.

Available variables in the evaluation context:
  • value: the current field value,

  • oldValue: the old field value,

  • values: all current field values (values.<field-name>).

Example validator to check the text length:
length(title) < 5

Permissions for all modules

Read any module

Determines if the role is allowed to access any Corteza Low Code module.

Update any module

Determines if the role is allowed to update any Corteza Low Code module.

Delete any module

Determines if the role is allowed to delete any Corteza Low Code module.

Create record under any module

Determines if the role is allowed to create records for any Corteza Low Code module.

Read records under any module

Determines if the role is allowed to access records for any Corteza Low Code module.

Update records under any module

Determines if the role is allowed to update records for any Corteza Low Code module.

Delete records under any module

Determines if the role is allowed to delete records for any Corteza Low Code module.

Permissions for a specific module

Read module "(module name)"

Determines if the role is allowed to access the given module.

Update module "(module name)"

Determines if the role is allowed to update the properties of the given module.

Delete module "(module name)"

Determines if the role is allowed to delete the given module.

Create record of module "(module name)"

Determines if the role is allowed to create record entries for the given module.

Read records of module "(module name)"

Determines if the role is allowed to access the records of the given module.

Update records of module "(module name)"

Determines if the role is allowed to update the records of the given module.

Delete records of module "(module name)"

Determines if the role is allowed to delete the records of the given module.

Permissions for all module fields

Read any module field

Determines if the role is allowed to see any Corteza Low Code module field.

Update any module field

Determines if the role is allowed to update any Corteza Low Code module field.

Permissions for a specific module field

Read "(field name)" record fields

Determines if the role is allowed to access the given value inside the module. This will hide any data that might appear in the field.

Update "(field name)" record fields

Determines if the role is allowed to update the values in the given module field. This will prevent any data manipulation for the field.