How to pre-fill form fields with data queried from another table in NocoBase?

Hi everyone,

I’m using NocoBase and have a question:

:point_right: When opening an Add New form, how can I:

  • Receive a preset value (e.g., barcode )
  • Automatically query data from another table (Products)
  • And pre-fill fields like name , price immediately when the form opens?

From what I understand:

  • Linkage Rules only run after a field changes
  • Default values can’t query another table

:point_right: Is there a way to achieve this kind of pre-fill? What is the best practice?

Thanks in advance!

Hello, in the data table, add a relationship field (many-to-one) to the business table and link it to the product table. In the form for adding new data to the business table, use the block’s field value function to set the default value of the field to be equal to the product attribute value in the relationship field. The product attribute value will then be passed to the form.

1 Like