Back to Nocobase

Form Block

docs/docs/en/interface-builder/blocks/data-blocks/form.md

2.0.482.9 KB
Original Source

Form Block

Introduction

The Form block is an important block for building data entry and editing interfaces. It is highly customizable, using corresponding components to display the required fields based on the data model. Through event flows like linkage rules, the Form block can dynamically display fields. Additionally, it can be combined with workflows to trigger automated processes and handle data, further improving work efficiency or implementing logic orchestration.

Add Form Block

  • Edit form: Used to modify existing data.
  • Add form: Used to create new data entries.

Block Settings

Block Linkage Rule

Control block behavior (such as whether to display it or execute JavaScript) through linkage rules.

For more details, see Block Linkage Rule

Field Linkage Rule

Control form field behavior through linkage rules.

For more details, see Field Linkage Rule

Layout

The Form block supports two layout modes, which can be set via the layout attribute:

  • horizontal: This layout displays the label and content in a single line, saving vertical space, suitable for simple forms or cases with less information.
  • vertical (default): The label is placed above the field. This layout makes the form easier to read and fill out, especially for forms with multiple fields or complex input items.

Configure Fields

Fields of this Collection

Note: Fields from inherited collections (i.e., parent collection fields) are automatically merged and displayed in the current field list.

Other Fields

  • Write JavaScript to customize the display content and show complex information.

Field template

Field templates let you reuse the field section configuration (selected fields, layout, and field settings) in Form blocks. See Field template.

Configure Actions