title: How to check if a key element exists and if present update it?
body: <p>I am using mule community edition. So no Dataweave. I am consuming a rest service in my application. In the json response from this backend rest service. I need to check if a particular element exists inside muliple multiple elements of an array and wherever it exists I need to update its value.</p>
  
  <p>E.g. (sample)</p>
  
  <pre><code>Input Request : [ { "id" : "1", "item" : "car", "make" : "Tonda" }, { "id" : "1", "item" : "car" } ]
  </code></pre>
  
  <p>using foreach to iterate array . Inside for each need to do something like below in expression component.</p>
  
  <pre><code>if( payload.make exists) { payload.make = "Tero"; }
  </code></pre>
  
  <p>But I do not know , how to check "if element exists"" condition. I tried below in expression component</p>
  
  <pre><code>if( payload.make != empty) { payload.make = "Tero"; }
  </code></pre>
  
  <p>But it did not work and gives error "Execution of the expression failed (org.mule.api.expression.ExpressionRuntimeException)"" for each array element wherever the particular key(make) is not present</p>