title: Extracting JSON Response using Bean Shell Postprocessor
body: <p>I am trying to extract the value of one variable of a JSON array using Beanshell postprocessor but I am not getting any response in log</p>
  
  <p>My JSON somewhat looks like:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>"store":
  :   [
  :   :   {
  :   :   :   "storeId":12345,
  :   :   :   "storeName":"ABC",
  :   :   :   "storeAddress":"DEFGHIJKL",
  :   :   :   "storeMinOrderAmount":100,
  :   :   :   "mobile":"+911234567890",
  :   :   :   "mobileSecondary":null,
  :   :   :   "city":"Somewhere",
  :   :   :   "pincode":123456,
  :   :   :   "country":"India",
  :   :   :   "email":"ptrm@company.com",
  :   :   :   "pickup":true,
  :   :   :   "delivery":false,
  :   :   :   "storeSplashPath":null,
  :   :   :   "storeSplashType":null,
  :   :   :   "distance":"0.10"
  :   :   },</code></pre>
  </div>
  </div>
  </p>
  
  <p>And my Beanshell Post Processor is:</p>
  
  <pre><code>import org.apache.commons.lang3.StringUtils;
  import org.json.JSONArray;
  import org.json.JSONObject;
  import com.eclipsesource.json.*;
  
  print("*******************");
  
  //Get Store total count
  int totalStoreNumber = StringUtils.countMatches(new String(data), "storeId");
  print("Total Number of Stores are: " + totalStoreNumber);
  
  if (totalStoreNumber &gt; 0) {
   //Check for Fulfilment type is "Pickup"
  String jsonString = prev.getResponseDataAsString();
  JsonObject store = JsonObject.readFrom(jsonString);
  JsonArray store = store.get("store").asArray();
  String pickup = store.get(1).asObject().get("pickup").asString();
  vars.put("fulfilmentType_BSH", pickup);
  print("Is Pickup allowed: " + pickup);
  }
  else {
   print("No Stores Nearby");
  }
  </code></pre>
  
  <p>I don't know where I am going wrong. I had read the related queries but couldn't get this right.
  Any Idea?</p>