IF THEN ELSE in create variable

I want to create a integer variable with a IF THEN ELSE. The IF is a enumaration. When I set the enumeration there will be the following error: expression must be of type boolean. I also tried 'tostring', but this won't work either. Does anyone know how I can solve this isue? Initial Value: if Registration.InvoiceFrequency.Jaar then $CurrentItem/BudgetVolume * 12 else $CurrentItem/BudgetVolume
1 answers

Rather than using if then else you can also use an exclusive split. Set the value to compare to $CurrentItem/Enum and then create an exit for each possible condition.

However if this is a special case and your enumeration is very large this might create an ugly microflow. So in that case you would like to use an If Then Else kind of thing. To do that create a change activirity for your $CurrentItem and set BugdgetVolume to If $CurrentObject/Enum = Registration.InvoiceFrequence.Jaar then $CurrentItem/BudgetVolume * 12 else $CurrentItem/BudgetVolume.

You also might want to add a check somewhere to make sure that BudgetVolume is not empty.