title: How to make json array from csv data set config using groovy script in jmeter
body: <p>I have a Csv file with multiple records(comma Seperated), i need a groovy script that can fetch all the data's from csv and make a json array and send a POST request in jmeter. Here is my code below. But it only fetches one record</p>
  
  <pre><code>import groovy.json.*
  import groovy.json.JsonBuilder
  
  def jsonBuilder = new groovy.json.JsonBuilder()
  jsonBuilder {
      id Integer.parseInt(vars.get("id"))
      name vars.get("first_name")
      last_name vars.get("last_name")
      email vars.get("email")
      institute_id Integer.parseInt(vars.get("institute_id"))
      category_id Integer.parseInt(vars.get("category_id"))
      value Boolean.parseBoolean(vars.get("value"))
  }
  
  sampler.addNonEncodedArgument("",jsonBuilder.toPrettyString(),"")
  sampler.setPostBodyRaw(true) 
  </code></pre>