Get value of parent object base on value from another object : <p>From a json, Can I get the value base on a value of key from another object? How will I do that? using array filter or for loop?</p>

<p>I have tried using array filter but it only returns the whole json object</p>

<p>Here is my sample JSON:</p>

<pre><code>[
  {
    "type":1,
    "key": "123abc",
    "data": {
        "access": "123456"
        "data": {
          "dataValue": [
            {
              "@attr": {
                 "@key": "Fire"
              },
              "@value": "Flame"
            },
            {
              "@attr": {
                 "@key": "Water"
              },
              "@value": "Liquid"
            },
            {
              "@attr": {
                 "@key": "Earth"
              },
              "@value": "Stone"
            }
          ]
        }
     }
  }
]
</code></pre>

<p>What I want is to get the "Liquid" value from @value by searching for "Water" from the "@key"</p>

<p>Output:
Liquid</p>

<p>Thanks you for those who will help.</p>
