textractjson ({"code":200})

Four Stars

textractjson ({"code":200})

Pls help I don´t know how to deal with this kind of json file:

 

I want to extract with tExtractJSONFields this file

 

{"status":{"code":200},"body":{"cars":[{"carId":8980,"carNr":"HPK 466","lon":11.6909065,"lat":47.3475876,"locality":"Austria, Vomp 0.91 km., \"E 45;E 60\" Inntal Autobahn","timestamp":"2018-02-23 18:23:33","ign":0,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":517052,"AW1":0,"AW2":0,"AW3":0,"AW4":0,"TW":0,"rpm":0,"fuel":545},{"carId":10577,"carNr":"JBJ 501 GC 620","lon":12.9923458,"lat":55.6282349,"locality":"Sweden, Malmö 2.87 km., Lappögatan","timestamp":"2018-02-23 18:28:28","ign":0,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":265986,"AW1":6900,"AW2":7900,"AW3":0,"AW4":0,"TW":0,"rpm":544,"fuel":1146},{"carId":11579,"carNr":"JGD 947 HH 717","lon":10.1392937,"lat":54.3190613,"locality":"Germany, Kiel 0.32 km., Schwedenkai","timestamp":"2018-02-23 18:24:12","ign":1,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":195243,"AW1":6000,"AW2":5000,"AW3":0,"AW4":0,"TW":0,"rpm":768,"fuel":984},{"carId":11574,"carNr":"JGD 948 HK 548","lon":9.6881142,"lat":52.6723175,"locality":"Germany, Buchholz 0.80 km., An der Autobahn","timestamp":"2018-02-23 18:41:56","ign":0,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":192304,"AW1":7100,"AW2":8800,"AW3":0,"AW4":0,"TW":0,"rpm":544,"fuel":210},{"carId":12881,"carNr":"JRC 474 GS 560","lon":10.0612526,"lat":59.0505219,"locality":"Norway, Larvik 1.97 km., \"40\" Elveveien","timestamp":"2018-02-23 18:34:16","ign":0,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":112703,"AW1":0,"AW2":3400,"AW3":0,"AW4":0,"TW":0,"rpm":0,"fuel":738},{"carId":13524,"carNr":"JZO 977","lon":13.1078205,"lat":59.32827,"locality":"Sweden, Slottsbron 0.52 km., \"E 18;E 45\"","timestamp":"2018-02-23 18:47:26","ign":1,"speed":70,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":67396,"AW1":0,"AW2":7900,"AW3":0,"AW4":0,"TW":0,"rpm":1152,"fuel":434},{"carId":13526,"carNr":"JZO 981","lon":10.8054276,"lat":45.5410995,"locality":"Italy, Affi 2.57 km./Verona 19 km., \"SP11\"","timestamp":"2018-02-23 18:47:09","ign":0,"speed":0,"b1n":"","b2n":"","b3n":"","b4n":"","b1v":0,"b2v":0,"b3v":0,"b4v":0,"t1":0.0,"t2":0.0,"odo":62148,"AW1":0,"AW2":6100,"AW3":0,"AW4":0,"TW":0,"rpm":0,"fuel":803}]}}

 My workflow:1.PNG2.PNG

 

My Problem:  Only null data in my output file.

Pls can you help me.

 

Kind Regards

Martin

 

 

Community Manager

Re: textractjson ({"code":200})

You should try using the JSONPath "Read By" option with this component. Then test it on a site like this: http://jsonpath.com

 

Looking at your JSON (formatted to be easier to read) and looking at your explanation, you JSONPath loop would be $.body.cars

 

Your individual records would simply be the record names, like "carId", "carNr", etc. 

 

{  
   "status":{  
      "code":200
   },
   "body":{  
      "cars":[  
         {  
            "carId":8980,
            "carNr":"HPK 466",
            "lon":11.6909065,
            "lat":47.3475876,
            "locality":"Austria, Vomp 0.91 km., \"E 45;E 60\" Inntal Autobahn",
            "timestamp":"2018-02-23 18:23:33",
            "ign":0,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":517052,
            "AW1":0,
            "AW2":0,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":0,
            "fuel":545
         },
         {  
            "carId":10577,
            "carNr":"JBJ 501 GC 620",
            "lon":12.9923458,
            "lat":55.6282349,
            "locality":"Sweden, Malmö 2.87 km., Lappögatan",
            "timestamp":"2018-02-23 18:28:28",
            "ign":0,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":265986,
            "AW1":6900,
            "AW2":7900,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":544,
            "fuel":1146
         },
         {  
            "carId":11579,
            "carNr":"JGD 947 HH 717",
            "lon":10.1392937,
            "lat":54.3190613,
            "locality":"Germany, Kiel 0.32 km., Schwedenkai",
            "timestamp":"2018-02-23 18:24:12",
            "ign":1,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":195243,
            "AW1":6000,
            "AW2":5000,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":768,
            "fuel":984
         },
         {  
            "carId":11574,
            "carNr":"JGD 948 HK 548",
            "lon":9.6881142,
            "lat":52.6723175,
            "locality":"Germany, Buchholz 0.80 km., An der Autobahn",
            "timestamp":"2018-02-23 18:41:56",
            "ign":0,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":192304,
            "AW1":7100,
            "AW2":8800,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":544,
            "fuel":210
         },
         {  
            "carId":12881,
            "carNr":"JRC 474 GS 560",
            "lon":10.0612526,
            "lat":59.0505219,
            "locality":"Norway, Larvik 1.97 km., \"40\" Elveveien",
            "timestamp":"2018-02-23 18:34:16",
            "ign":0,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":112703,
            "AW1":0,
            "AW2":3400,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":0,
            "fuel":738
         },
         {  
            "carId":13524,
            "carNr":"JZO 977",
            "lon":13.1078205,
            "lat":59.32827,
            "locality":"Sweden, Slottsbron 0.52 km., \"E 18;E 45\"",
            "timestamp":"2018-02-23 18:47:26",
            "ign":1,
            "speed":70,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":67396,
            "AW1":0,
            "AW2":7900,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":1152,
            "fuel":434
         },
         {  
            "carId":13526,
            "carNr":"JZO 981",
            "lon":10.8054276,
            "lat":45.5410995,
            "locality":"Italy, Affi 2.57 km./Verona 19 km., \"SP11\"",
            "timestamp":"2018-02-23 18:47:09",
            "ign":0,
            "speed":0,
            "b1n":"",
            "b2n":"",
            "b3n":"",
            "b4n":"",
            "b1v":0,
            "b2v":0,
            "b3v":0,
            "b4v":0,
            "t1":0.0,
            "t2":0.0,
            "odo":62148,
            "AW1":0,
            "AW2":6100,
            "AW3":0,
            "AW4":0,
            "TW":0,
            "rpm":0,
            "fuel":803
         }
      ]
   }
}
Community Manager

Re: textractjson ({"code":200})

Did this solve your problem?

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.