# Setup parent child relation based on rowIds

**URL:** <https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642>\
**Category:** Ask for Help\
**Created:** [March 2, 2021, 8:46am UTC](https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642 "2021-03-02T08:46:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ton\_van\_der\_Pol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ton_van_der_pol/32/22546_2.png) [@Ton\_van\_der\_Pol](https://community.glideapps.com/u/Ton_van_der_Pol)\
**Post date:** [March 2, 2021, 8:46am UTC](https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642/1 "2021-03-02T08:46:41Z")

</div>

I am learning Glide. I made a simple todo app. You can add lists and to each lists you can add todo Items. A list has many items and an item belongs to one list. For the relation between the lists and the items I used the name of the list. This works fine. the only thing is: when I change the name of a list, the relation brakes. Which makes sense of course.

In another post I learned that using rowIds is a way to solve this. You assign the rowId of the list to the item and you use a lookup column to show the name of the list. I understand the logic behind it, but I cannot figure out how to make this work in Glide.

How do I need to setup the relation from the list to the items correctly?  
How do I need to setup the relation from the items to the lists correctly?  
I want to add an item via a form. How do I assign a list to that item to setup the relation? I should be able to pick a list based on its name. And then the rowId should be stored to setup the relation. But it looks like this cannot be done with an choice dropdown.

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [March 2, 2021, 1:05pm UTC](https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642/2 "2021-03-02T13:05:48Z")

</div>

As you alread said you need a row id column in your parent table.  
In your child table create a column named parent id for example.  
The cohoice box has a option to show the name in the gui and write the rowid to your child table.

---

<div class="post-metadata">

**Author:** ![Ton\_van\_der\_Pol](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ton_van_der_pol/32/22546_2.png) [@Ton\_van\_der\_Pol](https://community.glideapps.com/u/Ton_van_der_Pol)\
**Post date:** [March 2, 2021, 1:57pm UTC](https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642/3 "2021-03-02T13:57:18Z")

</div>

I discovered where I went wrong. I thought I needed to make a relation column from the Parent ID. But I couldn’t set the relation column to the ID in the choice dropdown.

Now I created a text Parent ID in the child table and added a relation column mapping the Parent ID column to the List-\>RowID column.

Et voila, lesson learned.

Thanks.

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/setup-parent-child-relation-based-on-rowids/23642/4 "2024-01-17T16:53:17Z")

</div>


