Function that changes a decimal when selecting an enumeration

0
Hello, I have a decimal attribute and an enumeration one. I want the decimal to change to negative number when I select one of the enumerations, and positive to the other. Is there a way to do it other than with validations and the user to write – or +?   Thanks
asked
1 answers
1

Not completely sure what your case is, but you could add an onchange microflow to the enum that the user selects and then add a decision in the microflow like $object/enumattribute = positive if true change the decimal like this

if $object/decimalattribute < 0 then $object/decimalattribute *-1 else $object/decimalattribute

when the result is false from the decision changethe value as:

if $object/decimalattribute > 0 then $object/decimalattribute *-1 else $object/decimalattribute

Maybe this helps in your case.

answered