title: How to create cumulative array of IDs (obtained from Json response) on running a test scenario having CSV file in Karate Framework
body: <p>I have CSV file (with around 300 rows) to read values which is passed in Json payload. On executing this test scenario for every CSV file's row, a new ID is generated in Json response i.e. response consist of an ID for each row present in CSV file.</p>
  
  <p>Example:
  Id = 1 for CSV row 1
  Id = 2 for CSV row 2
  "
  "
  Id = n for CSV row n</p>
  
  <pre><code>Scenario Outline: Create new content value (using CSV file) for movie: &lt;Movie&gt; with Cast: &lt;Cast&gt;
      When json payload = {'attributes':[{'entity_attribute_id': 41, 'value': '&lt;Genre&gt;'},{'entity_attribute_id': 42, 'value': '&lt;Language&gt;'},{'entity_attribute_id': 39, 'value': '&lt;Movie&gt;'},{'entity_attribute_id': 101,'value': '2020-12-03'}],'entity_type_id': '10'}   
      Given url baseUrl + postContentValues   
      And def cookie = read('content-cookie.txt')
      And header cookie = cookie
      And request payload
      When method post
      Then status 200
      And print response
      And def contentId = response.id
      And print contentId
      And def createdContentIdList = karate.append(contentId)
      And print createdContentIdList
  #   And def createdContentIdList = karate.append(contentId)
  #   And def createdContentIdList = []
  #   And def fun = function(x){ karate.appendTo(createdContentIdList, x) }
  #   And karate.forEach(contentId, fun)
  #    And print createdContentIdList
      Examples:
      |read('RoughTable.csv')|
  
  Scenario Outline: Pass contentID in URL
  
      Given url baseUrl + getSpecificContentValue +'&lt;contentValueId&gt;' + '?client=web&amp;'
      When method get
      Then status 200
      And print response
  
      Examples:
      |contentValueId|
      |contentId     |
  </code></pre>
  
  <p>If I use karate.append() or karate .appendTo(), Following createdContentIdList is generated (which is incorrect):</p>
  
  <p><a href="https://i.stack.imgur.com/dr652.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dr652.png" alt="enter image description here"></a></p>
  
  <p>Now,I want to create an array (named ContentID) which has all row's IDs like 
  <strong>ContentID = [1,2,3,....n]</strong> </p>
  
  <p><strong>And Pass the content id one by one to next api's url.</strong></p>
  
  <p>How can I do this in Karate ?</p>
  
  <p>Thanks in advance !!</p>