Condition on enum value not working as expected

Hi,

I’m trying to use a very straight forward condition on an runtime only object’s enum value.

The UI is a repetable container showing the enum value invoice status. But when trying to set a condition to the enum value, e.g. invoice status = “betalt” then the condition only return false

Condition

data:

Hi Preben,

Could you share some more details on how your UI is set up? Where are you using this condition and what is the context of Invoice (temp) where this condition is used?

I’m planning to use it on a conditional style on a container, changing the color of the background based on the status.

Invoice (temp) is a list of invoices created from a web request where I use a function to set the invoice status on each line.

It could have something to do with the way I set the enum value on the records, but in the devtool it looks correct
Function to set enum values

I believe you would have to return the betalt.value in your switch if that’s the enum value.

When adding an enum value as a function property is comes as a key-value pair (unless you add the value part of the enum directly. I don’t know if you have done that and renamed it).

Could you verify if the betalt/delbetalt/ubetalt are key-value pairs, and if so that it works if you add the .value part in your return statements?

2 Likes

Thanks. That was the missing piece :slight_smile:

1 Like