-2
[  
   {  
      "mcClaimModelInfoId":{  
         "claim_no":"1019",
         "sno":1,
         "policy_no":"STC1001674000100"
      },
      "model_type":"1",
      "vehicle_count":"100",
      "remarks":"null",
      "status":"null",
      "entry_date":null
   },
   {  
      "mcClaimModelInfoId":{  
         "claim_no":"1019",
         "sno":2,
         "policy_no":"STC1001674000100"
      },
      "model_type":"1",
      "vehicle_count":"10",
      "remarks":"null",
      "status":"null",
      "entry_date":null
   },
   {  
      "mcClaimModelInfoId":{  
         "claim_no":"1019",
         "sno":3,
         "policy_no":"STC1001674000100"
      },
      "model_type":"8",
      "vehicle_count":"5454",
      "remarks":"null",
      "status":"null",
      "entry_date":null
   }
]
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Rajesh
  • 89
  • 5
  • 2
    Which programming language? Which value you want to get? What have you tried so far? What is Plss? – Alexxus Mar 27 '19 at 09:31
  • Hello, in order to get some help you should clarify your question. Please format your post in a way that explains what is your problem, what have you tried to solve it (with examples) and what didn't work. – Tux Mar 27 '19 at 09:38
  • That format is my JSON and I need all values from that help me – Rajesh Mar 27 '19 at 09:47

2 Answers2

0

An example in python:

import json
def test():
    model = ''' [{"mcClaimModelInfoId":{"claim_no":"1019","sno":1,"policy_no":"STC1001674000100"},"model_type":"1","vehicle_count":"100","remarks":"null","status":"null","entry_date":null}] '''
return json.loads(model)


test_one = test()
for m in test_one:
   print(m['mcClaimModelInfoId])

here is an example of how to do it in python, you are iterating through the json. You can do the same thing in Java or any other language.

json_line = line['mcClaimModelInfoId']['claim_no'] => 1019 (example)
MichaelB
  • 23
  • 5
0

Well since that what you are showing its just an array, and if... You want an example of access and iterate in c# here you have a simple way to do it:

using Newtonsoft.Json.Linq;
using Newtonsoft.Json;

JObject objTemp = JObject.Parse(yourJSON); //Converts the JSON to a JObject
JArray arr = JArray.Parse(objTemp["ArrayName"].ToString());
foreach (var arrElement in arr)
{
     var x = (string)arrElement["mcClaimModelInfoId"]["model_type"];
}
  • If you want in Java, you just need to do a simple research... https://stackoverflow.com/questions/1568762/accessing-members-of-items-in-a-jsonarray-with-java – Daniel Alexandre Mar 27 '19 at 10:54