0

Now Consider this String , If I give id as input which is present in inner loop can i get its status as output, if i have multiple projects and finally using java?If yes How?

"projects":
       [
           {
               "projectName": "example",
               "users":
               [
                   {
                       "userName": "xyz",
                       "executions":
                       [
                           {
                               "status": "check",
                               "runs":
                               [
                                   {
                                       "Id": "------",
                                       "Key": "---"
                                   }
                               ],
                               "RCount": 1
                           }
                       ],
                       "RCount": 1
                   }
               ],
               "RCount": 1
           }

    ,
Abdelhak
  • 8,299
  • 4
  • 22
  • 36

1 Answers1

0

You have to decompose the full object to reach the entries inside the arrays.

REPONSE_JSON_OBJECT.getJSONObject("projects").getJSONObject("users").getJSONObject("executions").getJSONArray("runs").getString("id");
Haseeb Anser
  • 494
  • 1
  • 5
  • 19
  • In the above json 'users' and 'executions' are defined as arrays , So if we use them as objects we cannot iterate in to the inner loops and getString is not applicable when i use in above maanner – akhil kapuganti Dec 02 '15 at 05:26