Join the Webstudio community

Updated yesterday

Nested collections

Hi

I want to group my data from Airtable. I am trying to make a public production plan, so that customers can see status of their order.

Each of these records in the attached screenshots are orders in the production plan. I want to group them for each production batch.

I tried to set up nested collections, so that the first Collection is the batch and the the second Collection is the order. But I can't find a way to only fetch the orders that is under each batch.

I am able to fetch all Orders under each Batch, and then hide the ones that do not have this Batch as a Airtable lookup field.

What is the smartest way to group collection items? Am I approaching it all wrong? Any help is appreciated πŸ™‚

Best, Malthe
Attachments
Skrmbillede_2025-04-03_kl._18.15.22.png
Skrmbillede_2025-04-03_kl._18.16.58.png
J
M
5 comments
Always a little tricky to chime in on this stuff because it takes me a bit to wrap my head around the data models, but this statement:

I am able to fetch all Orders under each Batch, and then hide the ones that do not have this Batch as a Airtable lookup field.

...sounds accurate. Does that not work for you?
Hi. Thank you for your reply!

To sum it up, I just want to group my records from Airtable by a category.

Regarding this:

"I am able to fetch all Orders under each Batch, and then hide the ones that do not have this Batch as a Airtable lookup field."

Doesnt the site then becoming very heavy? Will Webstudio load all the data for the ones that is hidden also?
The show/hide is done on the server so its a very quick and light operation.

I see two options

  1. Get all of them and show/hide
  2. Have them served up in their groups. Eg table 1 has all batches and table 2 has all orders. The in table 1 you add a lookup column and select each of the batches. If the data is served how I think it should, then you get exactly what you need. Idk the impact this would have on your editorial workflows though
Maybe in the builder it can become sluggish but it depends on how many records we are talking about
Thank you! Good to know that is done on the server. I went with option 1 it loads okay πŸ™‚
Add a reply
Sign up and join the conversation on Discord