Compare enums in functions

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:

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

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:

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

1 Like

Thanks for fast response :slight_smile:

1 Like