# Recursive Groupby in Lists stop working as expected

**URL:** <https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197>\
**Category:** Bugs & Issues\
**Created:** [May 17, 2024, 4:18am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197 "2024-05-17T04:18:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![New\_Turok](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/new_turok/32/1689_2.png) [@New\_Turok](https://community.fibery.io/u/New_Turok)\
**Post date:** [May 17, 2024, 4:18am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/1 "2024-05-17T04:18:40Z")

</div>

With Area database in space

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/4/49cac0d93ac39b3210c710049aa794513d163971.png)  
And many to many relation  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/87499feccfff7869ff3ab6229da7e8149a00cb45.png)  
Before 16.05 was showing only expected hierarchy  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/1/19dd1409a052b9aa96b8cf8543d35166b7dd086c.png)  
But after 16.05 it shows child entities on top level  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/7/77d3e22f3d53b6e4b112e648f58a9e8a622700f5.png)  
Levels setup  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/b/bdbc24427978f4cb923f5566feaa9d664f824dfe.png)

---

<div class="post-metadata">

**Author:** ![New\_Turok](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/new_turok/32/1689_2.png) [@New\_Turok](https://community.fibery.io/u/New_Turok)\
**Post date:** [May 17, 2024, 4:25am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/2 "2024-05-17T04:25:19Z")

</div>

By adding projects as childs to projects

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/5/5c285c2af0917f3a2f3dad87a32af46577236720.png)  
It stop showing projects at all  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/38418bcbacedb88d79385159d982eb6dc4b00a2f.png)

Template workspace

> **[Login](https://shared.fibery.io/sign-up?appShareId=2cd3813f-27cf-4992-aa9c-30399420f1ac-area)**
>
> Log in into your Fibery account. Build your company workspace with no code.

---

<div class="post-metadata">

**Author:** ![ihartrafimovich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ihartrafimovich/32/9_2.png) [@ihartrafimovich](https://community.fibery.io/u/ihartrafimovich)\
**Post date:** [May 17, 2024, 9:35am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/3 "2024-05-17T09:35:36Z")

</div>

Hello!

Thank you for the reporting the bug. Honestly, we never keep in mind the case of many-to-many recursive hierarchies and never tested it. The possibility to create such a List was _accidentally_ unlocked several weeks ago, together with the new List setup (with Groups). You can check, you cannot create a Smart Folder with the same setup in the old UI.

The simplest solution would be just to lock it back, and it feels right for me because in the case of many-to-many relation, the data structure is not a hierarchical tree, but rather a network, so the List it’s just not a suitable visualization for it.

But, to make the final decision, I would like to understand your use case, could you please explain why do you need many-to-many self-relation in your `Area <-> Project` setup, and why one-to-many doesn’t work for you?

---

<div class="post-metadata">

**Author:** ![New\_Turok](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/new_turok/32/1689_2.png) [@New\_Turok](https://community.fibery.io/u/New_Turok)\
**Post date:** [May 17, 2024, 1:04pm UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/4 "2024-05-17T13:04:16Z")

</div>

> [@ihartrafimovich](#):
>
> why one-to-many doesn’t work for you?

Just because of how many-to-many relation works)))  
I need some child areas be parts of different parent areas.

---

<div class="post-metadata">

**Author:** ![ihartrafimovich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ihartrafimovich/32/9_2.png) [@ihartrafimovich](https://community.fibery.io/u/ihartrafimovich)\
**Post date:** [May 17, 2024, 3:54pm UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/5 "2024-05-17T15:54:06Z")

</div>

Could you provide a real example? It’s actually hard for me to imagine.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [May 17, 2024, 4:47pm UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/6 "2024-05-17T16:47:51Z")

</div>

Not sure it’s practical, but another solution could be to add a “Strict Tree” flag on M2M relations to disallow linking entities that would break the strict hierarchy - i.e., disallow linking a new child entity that is already an ancestor.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [May 17, 2024, 5:46pm UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/7 "2024-05-17T17:46:48Z")

</div>

I imagine that could be technically quite difficult, given that the hierarchy is functionally unlimited in levels, so checking every ancestor branch could be prohibitively resource-intensive/time-consuming

---

<div class="post-metadata">

**Author:** ![New\_Turok](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/new_turok/32/1689_2.png) [@New\_Turok](https://community.fibery.io/u/New_Turok)\
**Post date:** [May 17, 2024, 11:45pm UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/8 "2024-05-17T23:45:29Z")

</div>

> [@ihartrafimovich](#):
>
> Could you provide a real example? It’s actually hard for me to imagine.

OK, real example.  
Area 1: Compliance  
Area 2: International relations  
Subarea for boths: Compliance with international legislation

---

<div class="post-metadata">

**Author:** ![ihartrafimovich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ihartrafimovich/32/9_2.png) [@ihartrafimovich](https://community.fibery.io/u/ihartrafimovich)\
**Post date:** [May 20, 2024, 8:34am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/9 "2024-05-20T08:34:02Z")

</div>

I’m thinking about it all the time, but it’s really technically challenging, as Chris mentioned. You need to have the whole _network_ in memory and analyze it every time you make linking. It can be done only on the backend, I am afraid. And it will never been a priority.

---

<div class="post-metadata">

**Author:** ![New\_Turok](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/new_turok/32/1689_2.png) [@New\_Turok](https://community.fibery.io/u/New_Turok)\
**Post date:** [May 20, 2024, 9:42am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/10 "2024-05-20T09:42:20Z")

</div>

Fine. I just point that it was working one week ago, and now it does not work.

---

<div class="post-metadata">

**Author:** ![ihartrafimovich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ihartrafimovich/32/9_2.png) [@ihartrafimovich](https://community.fibery.io/u/ihartrafimovich)\
**Post date:** [May 20, 2024, 11:31am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/11 "2024-05-20T11:31:05Z")

</div>

After some deliberation, I finally prohibited the creation of such views in production. But I hope it’s temporary and at the end of the week, I will be able to dive into your case.

---

<div class="post-metadata">

**Author:** ![ihartrafimovich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/ihartrafimovich/32/9_2.png) [@ihartrafimovich](https://community.fibery.io/u/ihartrafimovich)\
**Post date:** [June 6, 2024, 11:48am UTC](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/12 "2024-06-06T11:48:01Z")

</div>

Hi there, again 🙂

We fixed the many-to-many relations for your case in the recent release. Feel free to use it and provide your feedback on whether it works correctly now or not.
