Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
NarenS701
Contributor
Contributor

Multiple JSON reading using tfileinputjson or textractjsonfields

Hi Team,

I have provided the source JSON file structure and simple mapping to extract id from it.

my first mapping using tinputfilejson (used Readby as JsonPath) as doesnt return anything and second option with textractjsonfields (same Readby option) gave null output.

Can someone tell me what is wrong in it?

{

 "object": "list",

 "data": [

 {

  "id": "ID1",

 }

 ],

 "has_more": false

}

{

 "object": "list",

 "data": [

 {

  "id": "ID2",

 }

 ],

 "has_more": false

}

{

 "object": "list",

 "data": [

 {

  "id": "ID3",

 }

 ],

 "has_more": false

}

Thanks.

Labels (3)
1 Solution

Accepted Solutions
gjeremy1617088143
Creator III
Creator III

Hi in the first one I saw this :

 

{json 1}

{json 2}

{etc}

 

they have to be merged in this way :

 

[

{json 1}

,{json2}

,{etc}

]

View solution in original post

6 Replies
gjeremy1617088143
Creator III
Creator III

Hi it seems your JSON is not validate in a json validator.

You have to correct it before you want to extract something from it

Send me love and kudos

 

gjeremy1617088143
Creator III
Creator III

here is a valid one :

 

 

[{

      "object": "list",

      "data": [

         {

            "id": "ID1"

         }

      ],

      "has_more": false

   },

   {

      "object": "list",

      "data": [

         {

            "id": "ID2"

         }

      ],

      "has_more": false

   },

   {

      "object": "list",

      "data": [

         {

            "id": "ID3"

         }

      ],

      "has_more": false

   }

]

NarenS701
Contributor
Contributor
Author

Thanks for your reply. There is small mistake in above edited JSON. please ignore the comma in "id".

 

I simplified the JSON for reference here. Actually realtime file is huge. each object list like below is separate JSON. I could extract data from 1 JSON, but when it get merged into 1 single file with multiple object list it is not working.

{

 "object": "list",

 "data": [

 {

  "id": "ID3"

 }

 ],

 "has_more": false

}

gjeremy1617088143
Creator III
Creator III

Hi in the first one I saw this :

 

{json 1}

{json 2}

{etc}

 

they have to be merged in this way :

 

[

{json 1}

,{json2}

,{etc}

]

NarenS701
Contributor
Contributor
Author

Thanks @guenneguez jeremy​ . I made it working, like the same way you suggested.

gjeremy1617088143
Creator III
Creator III

select one of my answer as the best to close the ticket please