If statement in in Reformat

Are “if” statements possible to be used in the Reformat? when I try to use:

if ($in.0.foo > 2) {bar} else {$in.0.foo};

it says “Syntax error on token ‘if’”. And when I however over the red x it says “Syntax error on token ‘if’ HINT: Delete token”;

Are you limited to only do function transformation in the Community version?

jason

You can use the iif function in Reformats. You can also go into the source tab and write your own function to analyze the input and return the end result of your logic. I’ve resorted to doing that when I have complicated branching logic to evaluate values.

please disregard as I have solved this. The correct way to apply this in a transformer is with an “iff” statement:

iff($in.0.foo >= 2, bar,$in.0.foo);

hope that helps anyone else.