title: DataWeave 2.0 If else condition
body: <p>Am fairly new to Dataweave, trying to achieve simple if else condition based on below</p>
  <pre><code>if (vars.country == &quot;USA&quot;)
    { currency: &quot;USD&quot; }
  else { currency: &quot;EUR&quot; }
  </code></pre>
  <p>This works fine. However, when I am trying with other json variables as below, it fails</p>
  <pre><code>%dw 2.0
  output application/json encoding=&quot;UTF-8&quot;
  ---
  Name: &quot;ABC&quot;,
  if (vars.country == &quot;USA&quot;)
    { currency: &quot;USD&quot; }
  else { currency: &quot;EUR&quot; }
  </code></pre>