Skip to main content
Fields are the individual data points displayed and edited across your collections in Forest. By default, Forest exposes the fields that exist in your data source. You can then extend and customize them to match your business needs.

What are fields?

A field in Forest maps to a column, property, or attribute in your data source. Forest lets you go beyond that default mapping by:
  • Creating computed fields: derive new values from existing data or external APIs
  • Importing fields: pull in fields from related records directly into a collection
  • Renaming and removing fields: hide technical details and use business-friendly names
  • Adding write behavior: make computed or read-only fields editable
  • Adding validation rules: enforce stricter constraints beyond what your data source provides
  • Enabling filtering and sorting: make any field filterable or sortable
  • Handling binary data: configure how binary fields are displayed and uploaded

How field customization works

Field customization is applied in your back-end code using a fluent API on the collection object. Changes are applied at the back-end level and reflected in the Forest UI.
collection
  .addField('fullName', {
    columnType: 'String',
    dependencies: ['firstName', 'lastName'],
    getValues: (records, context) =>
      records.map(r => `${r.firstName} ${r.lastName}`),
  })
  .replaceFieldWriting('fullName', (value, context) => {
    const [firstName, lastName] = value.split(' ');
    return { firstName, lastName };
  })
  .addFieldValidation('fullName', 'Present')
  .addFieldValidation('fullName', 'ShorterThan', 30)
  .emulateFieldFiltering('fullName')
  .emulateFieldSorting('fullName')
  .removeField('firstName', 'lastName');

Explore field customization

Computed fields

Create new fields derived from existing data or external APIs

Import, rename & remove

Import fields from relationships, rename for clarity, or hide technical fields

Validation

Add validation rules beyond what your data source enforces

Write behavior

Make fields writable and control how writes are applied

Filtering & sorting

Enable filtering and sorting on any field, including computed ones

Binary fields

Configure how binary data is displayed and uploaded