# Nested Forms? Fill out two tables in one form

**URL:** <https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702>\
**Category:** Ask for Help\
**Created:** [May 4, 2025, 3:09pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702 "2025-05-04T15:09:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rommel\_Pascual](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rommel_pascual/32/68420_2.png) [@Rommel\_Pascual](https://community.glideapps.com/u/Rommel_Pascual)\
**Post date:** [May 4, 2025, 3:09pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/1 "2025-05-04T15:09:02Z")

</div>

I’m working on an enhancement for my chicken inventory app to track egg incubation through maturity. Here’s what I’m trying to achieve:

- Batch Table: Stores BatchID, SetDate, and other batch-level details.
- Eggs Table: Stores details of individual egg groups (usually 4–6 per batch), including EggID, fertility rate, and hatch rate.

Goal: Create a single form that lets users:

1. Create a new batch (saving to the Batch table).
2. Add multiple egg groups (saving each to the Eggs table) with their fertility/hatch rates, linked to the same BatchID.

Question: How can I design this in Glide? Ideally, users would fill out batch info first, then add egg group details in the same form—without needing multiple submissions.

I’ve considered:

- Using a form with a repeating section for egg groups.
- Using actions to update both tables after submission.
- Relationships between tables (e.g., Eggs linked to Batch via BatchID).

Has anyone built something similar? Any tips on structuring the tables or configuring the form would be amazing!

Thanks

Rommel

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 4, 2025, 4:55pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/2 "2025-05-04T16:55:34Z")

</div>

> [@Rommel\_Pascual](#):
>
> Goal: Create a single form that lets users:
> 
> 1. Create a new batch (saving to the Batch table).
> 2. Add multiple egg groups (saving each to the Eggs table) with their fertility/hatch rates, linked to the same BatchID.

What’s the difference between a “batch” and an “egg group”? Usually there are 4-6 egg groups per batch?

Generally speaking, if you are creating a new row in a Batch table, and then a new row in an Eggs table related to the batch just previously created, I would create two separate native forms.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [May 4, 2025, 10:24pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/3 "2025-05-04T22:24:48Z")

</div>

Totally agree with @nathanaelb about two different forms: for data reasons, for UX reasons and for simplicity reasons 😛

Here’s a quick example of something that comes close to your request. The idea is to simulate a 2 steps form in order to provide to users a flowless approach.  
 ![2 steps form: Batch → Egg Group](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/4/14a12ab347244e4566bc465df91f728076c621ed.gif "2 steps form: Batch → Egg Group")

  

The **Data** part is based on 2 tables, `Batch` and `Eggs`:

 ![Batch table](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/d/ed4f66bcda35b1e04f02dbc82d738e2191c00d4e.png "Batch table")  
 ![Eggs table](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/b/4b2f693394af3b438cb0d70ab51193b937a29679.png "Eggs table")

  

In the **Layout** , a Table component let you add data to `Batch` table

 ![Add a Batch](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/5/b563e2e82dae4679bbfb7219d78f9c82fb298203.png "Add a Batch")

The nice option here is to change to “On Submit” action to “Show detail screen \> This item”. It will trigger the second step to let user add egg groups:

 ![Show detail on submit](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/69c6c302da342c6b77982c47646f0ac467189345.png "Show detail on submit")

And at the end, we have a… Data Grid (with `Related Eggs` column as Source) with an “Add en Egg Group” action:

 ![Add an Egg Group](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/0/206705101530ef6e3893e18eafe6635a0e10aec9.png "Add an Egg Group")

Because it was easy and fun to do it with Glide, you can also add a “Delete row \> This Item” action column, to let user Delete a specific row if he/she has added to many (for instance):

 ![Delete row](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/9/59859788262264165765f7adec5efcee2d57d085.png "Delete row")

  

It’s just an idea, and to summarize your considerations:

> [@Rommel\_Pascual](#):
>
> - Using a form with a repeating section for egg groups.

UX reason: from a User perspective, please do not add “empty” sections if it’s not necessary. The Data Grid is cool because it’s the user who decides the number of rows to add (with a Delete option)

> [@Rommel\_Pascual](#):
>
> - Using actions to update both tables after submission.

Simplicity reason: even if it’s possible to do that in Glide, you would use a single workflow to mix two differents topics. It’s easier to have one action to make something (like adding a new Batch) and another one to make something else (like adding an Egg Group). This way, you’ll also be able to reuse the “Add an Egg Group” workflow if you have to edit a Batch later on (for example).

> [@Rommel\_Pascual](#):
>
> - Relationships between tables (e.g., Eggs linked to Batch via BatchID).

Data reason: you’re right my dear Rommel, very clever to create a relation between these two tables. Because you open the Detail Screen of a record, you can easily pass the Row ID value to the “sub” form. That’s what we do here 😉

  

Hope this gives you some insights 🙂

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 4, 2025, 10:43pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/4 "2025-05-04T22:43:20Z")

</div>

Hello to you too, Nicolas 🙂

> [@Nicolas\_Joseph](#):
>
> The nice option here is to change to “On Submit” action to “Show detail screen \> This item”.

I tend to avoid this. I rarely use the `On Submit` action, and when I do, I avoid an action that will apply to a row that was just created. I think I learnt this from Jeff or Darren. It makes sense, since in this particular instance, applying an action upon submission to a row that was just created a fraction of a second prior might be looking for trouble. What if the on-submit action triggers just before the row is added to the database?

> [@Nicolas\_Joseph](#):
>
> Simplicity reason: even if it’s possible to do that in Glide, you would use a single workflow to mix two differents topics.

👆  
I agree with this 100%.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 4, 2025, 11:44pm UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/5 "2025-05-04T23:44:46Z")

</div>

> [@nathanaelb](#):
>
> I tend to avoid this. I rarely use the `On Submit` action, and when I do, I avoid an action that will apply to a row that was just created. I think I learnt this from Jeff or Darren. It makes sense, since in this particular instance, applying an action upon submission to a row that was just created a fraction of a second prior might be looking for trouble. What if the on-submit action triggers just before the row is added to the database?

In my experience, this works fine. It’s only when you do “Set columns” that the problems start to appear.

I usually don’t have the allowance to be able to have 2-step forms like what Nicolas suggested. Clients usually want to be able to add children items in the same form screen.

My workaround is using a custom form. I set a unique ID on entry to the form screen, then allow them to add/edit/delete the children items using that unique ID and a relation.

In those cases, there’s a chance they abandon the form mid-way and you have children items that are never associated with a “completed” parent item. I set up a workflow to delete them if the relation to a parent isn’t there after 2-3 days.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 5, 2025, 3:16am UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/6 "2025-05-05T03:16:44Z")

</div>

> [@ThinhDinh](#):
>
> My workaround is using a custom form. I set a unique ID on entry to the form screen, then allow them to add/edit/delete the children items using that unique ID and a relation.

That’s the approach that I use.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 12, 2025, 3:17am UTC](https://community.glideapps.com/t/nested-forms-fill-out-two-tables-in-one-form/81702/7 "2025-05-12T03:17:05Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
