# If statement in in Reformat

**URL:** <https://forum.cloverdx.com/t/if-statement-in-in-reformat/1640>\
**Category:** CloverDX Platform\
**Created:** [June 11, 2015, 12:00am UTC](https://forum.cloverdx.com/t/if-statement-in-in-reformat/1640 "2015-06-11T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jblythe99](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jblythe99](https://forum.cloverdx.com/u/jblythe99)\
**Post date:** [June 11, 2015, 12:00am UTC](https://forum.cloverdx.com/t/if-statement-in-in-reformat/1640/1 "2015-06-11T00:00:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dtaylor](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dtaylor](https://forum.cloverdx.com/u/dtaylor)\
**Post date:** [June 12, 2015, 1:16pm UTC](https://forum.cloverdx.com/t/if-statement-in-in-reformat/1640/2 "2015-06-12T13:16:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jblythe99](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jblythe99](https://forum.cloverdx.com/u/jblythe99)\
**Post date:** [June 12, 2015, 1:47pm UTC](https://forum.cloverdx.com/t/if-statement-in-in-reformat/1640/3 "2015-06-12T13:47:44Z")

</div>

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.
