title: karate scenario outline - Create a dynamic example table based on JSON array index size
body: <p>Here I would like to clarify about creating dynamic example table for a dynamic JSON index size</p>
  
  <p>My JSON looks like</p>
  
  <p><strong>Env - Dev - 2 servers</strong></p>
  
  <pre><code>"response": {
      "abc": [{
              "status": "pass"
                  .
                  .
          },
          {
              "status": "pass"
                  .
                  .
          }
      ]
  }
  </code></pre>
  
  <p><strong>Env - Uat - 3 servers</strong></p>
  
  <pre><code>{
      "response": {
          "abc": [{
                  "status": "pass"
              },
              {
                  "status": "pass"
              },
              {
                  "status": "pass"
              }
          ]
      }
  }
  </code></pre>
  
  <p><strong>My scenario outline looks like</strong> </p>
  
  <pre><code>Scenario Outline: validating .....
  
  When def result = callonce read('featurefilename@tagname')
  
  Then print result
  
  And print &lt;status&gt;
  
  And print ...
  
  And match ....
  
  Examples:
  
  |result.response.abc|
  
  </code></pre>
  
  <p><strong>Errors for the above:</strong></p>
  
  <p>1) * dynamic expression evaluation failed:result.response.abc</p>
  
  <p>2) com.intuit.karate.karateExpresion: ---- javascript evaluation failed result.response.abc, ReferenceError:"result" is not defined in  at line number 1</p>
  
  <p>Note - If I move step 'When def result = callonce read('featurefilename@tagname') to background it's working as expected but I can't use background in my feature file due to other factors.</p>
  
  <p>Thanks in advance</p>