title: How to get all values where a certain Key matches in Dataweave 2.0?
body: <p><strong>Payload :</strong></p>
  <pre><code>[
  {
      &quot;Contacts&quot;: &quot;123456,098765&quot;,
      &quot;Emails&quot; : &quot;&quot;
  },
  {
      &quot;Contacts&quot;: &quot;ABC123&quot;,
      &quot;Emails&quot; : &quot;&quot;
  }
  ]
  </code></pre>
  <p>How can I get a list of all emails from the below array of objects where the contact Id matches from each row in the payload? (Expected output below)</p>
  <p><strong>Variable accConts</strong></p>
  <pre><code>{
      &quot;queryResponse&quot;: [
          {
              &quot;Email&quot;: &quot;test123@test.com&quot;,
              &quot;SalesforceId&quot;: &quot;123456&quot;
          },
          {
              &quot;Email&quot;: &quot;test@test.com&quot;,
              &quot;SalesforceId&quot;: &quot;098765&quot;
              
          },
          {
              &quot;Email&quot;: &quot;ABC@test.com&quot;,
              &quot;SalesforceId&quot;: &quot;ABC123&quot;
              
          }
  
      ]
  }
  </code></pre>
  <p><strong>Expected Output:</strong></p>
  <pre><code>[
  {
      &quot;Contacts&quot;: &quot;123456,098765&quot;,
      &quot;Emails&quot; : &quot;test123@test.com, test@test.com&quot;
  },
  {
      &quot;Contacts&quot;: &quot;ABC123&quot;,
      &quot;Emails&quot; : &quot;ABC@test.com&quot;
  }
  ]
  </code></pre>