# Button that add relation, but remove existing ones

**URL:** <https://forum.adalo.com/t/button-that-add-relation-but-remove-existing-ones/11720>\
**Category:** Get Help\
**Created:** [April 22, 2021, 9:16pm UTC](https://forum.adalo.com/t/button-that-add-relation-but-remove-existing-ones/11720 "2021-04-22T21:16:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![civec](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@civec](https://forum.adalo.com/u/civec)\
**Post date:** [April 22, 2021, 9:16pm UTC](https://forum.adalo.com/t/button-that-add-relation-but-remove-existing-ones/11720/1 "2021-04-22T21:16:59Z")

</div>

Hi, I am adding relations through a list in order to categorize what data another list displays. However, I want the the lists that set relations (add relations) to also remove any existing relations, or else the entire categorization system fails. How can this be done?

Thanks!

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [April 22, 2021, 11:19pm UTC](https://forum.adalo.com/t/button-that-add-relation-but-remove-existing-ones/11720/2 "2021-04-22T23:19:44Z")

</div>

Hi @civec ,

If your relationship property is 1-to-m, it will automatically be replaced.

If it is many-to-many, you need update action and remove and add collection name.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [May 2, 2021, 11:20pm UTC](https://forum.adalo.com/t/button-that-add-relation-but-remove-existing-ones/11720/3 "2021-05-02T23:20:47Z")

</div>

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