# How to maintain relationship when key in parent changes

**URL:** <https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903>\
**Category:** Ask for Help\
**Created:** [January 30, 2022, 11:02pm UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903 "2022-01-30T23:02:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blaine](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blaine/32/37970_2.png) [@Blaine](https://community.glideapps.com/u/Blaine)\
**Post date:** [January 30, 2022, 11:02pm UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/1 "2022-01-30T23:02:14Z")

</div>

I have a property management app using google sheets where the table “properties” is related to the table “tenants” and there are several other tables like “expenses” that are related as well to the “properties” table. The application is coming along nicely but how would others manage the situation where if the user changes the name of the property in the main table - ie they miss-spelled it and there were already related records in the other tables/sheets.

I am starting to think that I need to change the structure of the tables to use the property row\_id so the relationship would not be affected if the property name changed. I’ve been going down the road of using an Apps Script and the onEdit event to maintain the relationship – it’s doable but as I write this post explaining my question, it’s becoming more obvious to me that I need to use Row ID or other unique key in the properties table.

Thoughts from others more experienced …

Thanks!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 30, 2022, 11:04pm UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/2 "2022-01-30T23:04:25Z")

</div>

I always use Row ID’s or Unique ID’s for that exact same reason.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 30, 2022, 11:05pm UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/3 "2022-01-30T23:05:34Z")

</div>

This is why you should always make your relations using unique keys (row IDs) instead of names…

… @Jeff_Hager beat me to the punch!

---

<div class="post-metadata">

**Author:** ![Blaine](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blaine/32/37970_2.png) [@Blaine](https://community.glideapps.com/u/Blaine)\
**Post date:** [January 30, 2022, 11:06pm UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/4 "2022-01-30T23:06:21Z")

</div>

LOL, thanks guys for such a quick reply 🙂

---

<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:** [January 31, 2022, 3:03am UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/5 "2022-01-31T03:03:58Z")

</div>

_Always_ use RowID’s/UniqueID’s in this situation.

oh, wait… you already got that answer.

😉

---

<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:** [February 1, 2022, 3:04am UTC](https://community.glideapps.com/t/how-to-maintain-relationship-when-key-in-parent-changes/37903/6 "2022-02-01T03:04:40Z")

</div>

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