# Formula: Filter() with custom state property is slow

**URL:** <https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151>\
**Category:** Bugs & Issues\
**Created:** [November 10, 2020, 1:04pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151 "2020-11-10T13:04:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haslien](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/haslien/32/493_2.png) [@Haslien](https://community.fibery.io/u/Haslien)\
**Post date:** [November 10, 2020, 1:04pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/1 "2020-11-10T13:04:49Z")

</div>

~~Not sure if it’s slow, if there’s some sort of bug, or even that I am doing it wrong.  
I actually suspect it is _very_ slow as I saw counter of different formula field “N of Archived” change after a long while.~~  
**Update:** It is indeed slow. Took about 10~15 minutes and now it shows as expected.

**Expected:** Formula in parent that check if all children have property of state “Archived” to be true, should return true.

**Result:** It always shows false.

**Setup:**  
3 entities with a Workflow extension with 3 states, where two are “Final”.

 ![](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/93c8e03d781463bc54f77a33d3d4577c311623f5.png)

States also have a custom field “Archived” which is true for one of the states.

 ![](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/8fb6717277e45219186b2bfc09cf1b10cb035f2f.png)

Formula of Parent returning Boolean. Should be true when all children have state “Archived”:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/8c7a11b144d0e18ff309f3418b7a24c8617b34f0.png)

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [November 10, 2020, 2:57pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/2 "2020-11-10T14:57:38Z")

</div>

Hi!  
Not sure, but suppose, that formula has to look like  
Children.Filter(State.Name = “Archived”).Count() = Children.Count()

Could you please have a try?

---

<div class="post-metadata">

**Author:** ![Haslien](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/haslien/32/493_2.png) [@Haslien](https://community.fibery.io/u/Haslien)\
**Post date:** [November 10, 2020, 3:16pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/3 "2020-11-10T15:16:23Z")

</div>

Matching name on this also seems to be slow.  
Here’s a full video example

[https://i.thevirt.us/11/99q5a.mp4](https://i.thevirt.us/11/99q5a.mp4)

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [November 10, 2020, 4:03pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/4 "2020-11-10T16:03:54Z")

</div>

Hello!

It seems this formula does not work at the moment. Our monitoring showed a lot of errors on your formula, and just today I added a Bug about this. So hopefully it will be fixed next week.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [November 10, 2020, 4:06pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/5 "2020-11-10T16:06:33Z")

</div>

As a workaround you may add 2 formulas with count, and a third formula that would compare those 2 formulas. Lol, but should work. Sorry for inconvenience.

---

<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:** [November 10, 2020, 4:47pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/6 "2020-11-10T16:47:03Z")

</div>

Is it intended that it is possible to return a boolean by using State.enum\_name in a formula (as opposed to using State.Name = enum\_name) ?  
Like Polina, I wouldn’t have expected Haslien’s formula to actually work anyway…

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [November 10, 2020, 5:28pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/7 "2020-11-10T17:28:10Z")

</div>

As Haslien has mentioned, “Archived” is not a state name. It is a boolean field, which he added to State type. This possibility is a bit hidden on UI, but it is actually possible to add fields to Single Select Type in fibery. As Single Select(or Multi Select) internally not differs from any other type.

---

<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:** [November 10, 2020, 7:57pm UTC](https://community.fibery.io/t/formula-filter-with-custom-state-property-is-slow/1151/8 "2020-11-10T19:57:42Z")

</div>

ooops, didn’t see that…my bad
