title: How to check if condition in foreach using logic app in efficient way?
body: <p>I have two array variables in for each i compare values one by one abd process further but issue is it is taking to much time for executing when I have 1000 of records.</p>
  
  <p>Variable_1 having around 10 records 
  Variable_2 which is output if HTTP will have around 1000+ records </p>
  
  <pre><code>Variable_1 = 
  [
      {
  
        "Name": "AAA",
        "OwnerId": "121a",
  
      },
      {
  
        "Name": "BBB",
        "OwnerId": "123b",
  
      },
      ...
  ]
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Variable_2 = 
  [
      {     
        "Demo_Name": "AAA"     
      },
      {  
        "Demo_Name": "BBB"
      },
      {  
        "Demo_Name": "BBB"
      },
      {  
        "Demo_Name": "BBB"
      },
      {  
        "Demo_Name": "BBB"
      }
      .... 
  ]
  </code></pre>
  
  <p>I have used <code>2 for each one is for</code>Variable_1<code>and another is for</code>Variable_2``.</p>
  
  <p>and comparing <code>Variable_1.Name == Variable_2.Demo_Name one by one</code>. </p>
  
  <p>so when <code>Variable_2</code> is having more than <code>1000+ records</code> it took around a hour to check condition one by one </p>
  
  <p>any solution for this to do it in a fast way?
  outer loop is taking around 2h 
  <a href="https://i.stack.imgur.com/OEPsD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OEPsD.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>If I try <code>concurrent execution</code> then <code>increment variable</code> set wrong
    values</p>
  </blockquote>