import org.json.*; String avashowOID=""; JSONArray ShowALLStatus = new JSONArray(vars.get("data")); for(int i=0;i<ShowALLStatus.length();i++){ JSONObject aaa = new JSONObject(ShowALLStatus.get(i).toString()); JSONObject bbb = new JSONObject(aaa.get("showStatus").toString()); String ccc= bbb.get("name").toString(); if(ccc.equals("ONSALE")){ JSONObject json2 = aaa; avashowOID= json2.get("showId").toString(); break; } } vars.put("showid",avashowOID.toString());