# Can I prevent infinite loops in formulae?

**URL:** <https://community.fibery.io/t/can-i-prevent-infinite-loops-in-formulae/6346>\
**Category:** Get Help\
**Created:** [July 2, 2024, 2:14pm UTC](https://community.fibery.io/t/can-i-prevent-infinite-loops-in-formulae/6346 "2024-07-02T14:14:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 2, 2024, 3:24pm UTC](https://community.fibery.io/t/can-i-prevent-infinite-loops-in-formulae/6346/2 "2024-07-02T15:24:14Z")

</div>

> [@HereBeBeasties](#):
>
> It would be nice if:  
> The error mentioned which entities this affects, so you can at least go and fix them and re-enable it.

Yeah, we want to make this, and other errors, easier to debug. Not sure when we’ll work on it.

> [@HereBeBeasties](#):
>
> It would be nice if:  
> Fibery didn’t let you do this in the first place.

It’s actually quite hard to do performantly, since [it would imply a potentially unlimited search through the relationship tree](https://community.fibery.io/t/recursive-groupby-in-lists-stop-working-as-expected/6197/7).

> [@HereBeBeasties](#):
>
> Or can I make a formula that somehow detects such loops and makes the calculation work regardless? (I would need to add the entities to a set as I went and check it, or something.)

I can’t think of a way of solving this using the existing Fibery capabilities.  
Maybe something will become possible if/when Fibery has a [union function](https://community.fibery.io/t/union-function-to-merge-multiple-collections-into-a-single-collections-field/5680) in formulas 🤔

---

_[View the full topic](https://community.fibery.io/t/can-i-prevent-infinite-loops-in-formulae/6346)._
