How to Display Related "Order Details" Based on Selected "Order" Row

I’m working with two collections: Orders and Order Details, connected via a one-to-many relationship from Orders to Order Details.

I’d like to create an Order page that includes:

  • An Orders table block at the top
  • An Order Details table block positioned below it

My goal is to make the interface dynamic—so that when a user clicks on a row in the Orders table, the Order Details table automatically updates to show only the records related to the selected Order.

Is this kind of interaction possible in NocoBase? If so, could someone guide me on how to implement it?

Thanks in advance!

Yes this is possible by using the connect data block feature. Have a look at the last example in these docs:

https://docs.nocobase.com/handbook/ui/blocks/block-settings/connect-block

I’m trying to display related Order Details based on the selected row in the Order table block, but I’m not sure if I’m configuring it correctly.

Here’s what I’ve done so far:

  • I created a one-to-many relationship from the Order collection to the Order Details collection, using ID as both the source and foreign key.
  • I also set up a many-to-one relationship from Order Details back to Order, again using ID as the source and foreign key.
  • I added two table blocks: one for the Order collection and one for the Order Details collection.
  • In the Order table block, I enabled the Connect to datablock feature and linked it to the Order Details table block.

The issue I’m facing is this: When I click on a row in the Order table block, the Order Details block remains empty. However, if I double-click the row (which seems to unfocus it), the Order Details block displays all records—unfiltered.

Is there something I’m missing in the configuration? I’d appreciate any guidance on how to make the Order Details block dynamically show only the records related to the selected Order.

You only need create a relationship in Order Details back to Order (2 fields: foreign key and association field)

Just to confirm—if I want a single Order to include multiple Order Details, I should set up a one-to-many relationship from Order to Order Details, correct? Or am I misunderstanding how this should be configured?

Specifically, I’m aiming for a form setup where I can input multiple Order Details entries in a sub-table mode directly within the Order form. Is this the right approach for that kind of structure?

I would recommend to set this up as follows:

  1. Create a many to one relation in order details back to the orders table.
  2. Make sure to check the checkbox that says (create a field in the related table).

You only need that one relationships, and checking the checkbox will allow you to use sub-table or sub-form to create multiple order details while creating a new order.

Thank you for your guidance.