title: How to access data inside nested loop in Handlebars?
body: <p>I have data as follows where <code>keyPairs</code> is dynamic columns of a table and <code>data</code> has the row data.</p>
  <pre><code>keyPairs: {
  &quot;key0&quot;:&quot;Value0&quot;,
  &quot;key1&quot;:&quot;Value1&quot;,
      ...
  }
  
  data:[
  {
  &quot;name&quot;:&quot;name0&quot;,
  &quot;key0&quot;:&quot;Value0&quot;,
  &quot;key1&quot;:&quot;---&quot;,
  },
  
  {
  &quot;name&quot;:&quot;name1&quot;,
  &quot;key0&quot;:&quot;---&quot;,
  &quot;key1&quot;:&quot;Value1&quot;,
  }]
  </code></pre>
  <p>The <code>keyPairs</code> object is dynamically created, and the keys used in each object in the <code>data</code> array are the same as the keys in <code>keyPairs</code>. I am unable get the values for each <code>data</code> item with each <code>@key</code> from <code>keyPairs</code>.</p>
  <pre><code>{{#each data as | row |}}
      &lt;td&gt;
          {{row.name}}
      &lt;/td&gt;
  
  {{#each ../keyPairs}}
      &lt;td&gt;
          {{./row[@key]}}
      &lt;/td&gt;
  {{/each}}
  {{/each}}
  </code></pre>