# Which 'final' state

**URL:** <https://community.fibery.io/t/which-final-state/1193>\
**Category:** Get Help\
**Created:** [November 26, 2020, 5:59pm UTC](https://community.fibery.io/t/which-final-state/1193 "2020-11-26T17:59:00Z")\
**Posts on this page:** 3\
**Page:** 1

<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 26, 2020, 5:59pm UTC](https://community.fibery.io/t/which-final-state/1193/1 "2020-11-26T17:59:00Z")

</div>

If I use the action button to set an entity’s state to final using `fibery.setStateToFinal` what happens if there is more than workflow state for which ‘Final’ is true?

---

<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:** [December 6, 2020, 9:24am UTC](https://community.fibery.io/t/which-final-state/1193/2 "2020-12-06T09:24:19Z")

</div>

Hi, Chris!  
Sorry for the long answer  
Well, it will select a random one and will throw an error at you. Never thought about this situation, telling the truth, and not sure about expected behaviour for this case 🙂

---

<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:** [December 7, 2020, 10:59am UTC](https://community.fibery.io/t/which-final-state/1193/3 "2020-12-07T10:59:07Z")

</div>

I would expect first match when picking, and when checking `true` if any.

To get around the above problem, I would instead add a boolean to the state to check against. I am actually doing this as we have two complete states: completed and archived.

In this case it would make sense that `final` match the first, which is Completed as it’s before Archived. Then for checking Archived state, I check for a “Archived” boolean on the states.
