# Compare enums in functions

**URL:** <https://community.appfarm.io/t/compare-enums-in-functions/994>\
**Category:** Ask the community\
**Tags:** function-editor\
**Created:** [January 18, 2024, 10:01am UTC](https://community.appfarm.io/t/compare-enums-in-functions/994 "2024-01-18T10:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eirikhs](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@eirikhs](https://community.appfarm.io/u/eirikhs)\
**Post date:** [January 18, 2024, 10:01am UTC](https://community.appfarm.io/t/compare-enums-in-functions/994/1 "2024-01-18T10:01:31Z")

</div>

How do I compare enums in functions?  
E.g. compare the built in “Appfarm Environment” enum with the built in “Active Environment” enum value.

The following doesn’t seem to work:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/9fd6bc51c26e1e81442de12d74918b5802d11c64.png)

I have also tried with combinations of `activeEnvironment.value` and `appfarmEnvironment.production.value`

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [January 18, 2024, 10:41am UTC](https://community.appfarm.io/t/compare-enums-in-functions/994/2 "2024-01-18T10:41:00Z")

</div>

Hi Eirik, and welcome to our community!

What you want to do here is to take in `activeEnvironment` as a Function Param (as you have already done) and then take in `production` as a Function Param from the list of Enum Constants, found here:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/4574e67a3fc07a597f19b2a48d99668d239b7c69.png)

Then you compare `activeEnvironment === production.value` and that should do the trick!

---

<div class="post-metadata">

**Author:** ![eirikhs](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@eirikhs](https://community.appfarm.io/u/eirikhs)\
**Post date:** [January 19, 2024, 12:16pm UTC](https://community.appfarm.io/t/compare-enums-in-functions/994/3 "2024-01-19T12:16:20Z")

</div>

Thanks for fast response 🙂
