<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Parse JSON with “empty key” in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347133#M114449</link>
    <description>&lt;P&gt;to get all the values :&lt;/P&gt;&lt;P&gt;i read a first time the json with these query :&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;LoopJsonpath query : "$"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;column : json query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;firstName : "firstName"&lt;/P&gt;&lt;P&gt;phone : "$.['phone.Numbers'][*]."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i use a tflowtoiterate to stock the value in globalmap and iterate each phone infos of the contact.&lt;/P&gt;&lt;P&gt;and i read again with textractjsonfield the phone string :&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;LoopJsonpath query : "$.[*]"&lt;/P&gt;&lt;P&gt;column : json query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type : "type"&lt;/P&gt;&lt;P&gt;number : "number"&lt;/P&gt;&lt;P&gt;empty : "['']"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and in a tjavarow i add the field i stock before in tflowtoiterate like firstName&lt;/P&gt;&lt;P&gt;ex : if i iterate row3 in my job :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output_row.firstName = ((String)globalMap.get("row3.firstName"));&lt;/P&gt;&lt;P&gt;output_row.type = input_row.type;&lt;/P&gt;&lt;P&gt;output_row.number = input_row.number;&lt;/P&gt;&lt;P&gt;output_row.empty = input_row.empty;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 07:44:12 GMT</pubDate>
    <dc:creator>gjeremy1617088143</dc:creator>
    <dc:date>2021-06-08T07:44:12Z</dc:date>
    <item>
      <title>Parse JSON with “empty key”</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347131#M114447</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are having a scenario in which we have a JSON with “empty key”. We are unable to parse data for the corresponding key &lt;/P&gt;&lt;P&gt;Sample data as below.&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"firstName": "John",&lt;/P&gt;&lt;P&gt;"lastName" : "doe",&lt;/P&gt;&lt;P&gt;"age" : 26,&lt;/P&gt;&lt;P&gt;"address" : {&lt;/P&gt;&lt;P&gt;"streetAddress": "naist street",&lt;/P&gt;&lt;P&gt;"city" : "Nara",&lt;/P&gt;&lt;P&gt;"postalCode" : "630-0192"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;"phone.Numbers": [&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"type" : "iPhone",&lt;/P&gt;&lt;P&gt;"number": "0123-4567-8888",&lt;/P&gt;&lt;P&gt;"" : "abcd",&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"type" : "home",&lt;/P&gt;&lt;P&gt;"number": "0123-4567-8910",&lt;/P&gt;&lt;P&gt;"" : "pqr",&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;We are using JSON query for the same to parse in tFileInputJSON.&lt;/P&gt;&lt;P&gt;Please help if anyone came across with this scenario &lt;A href="https://huydungmobile.com/sua-chua-iphone/thay-pin-iphone/" alt="https://huydungmobile.com/sua-chua-iphone/thay-pin-iphone/" target="_blank"&gt;replace battery iPhone&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;davillan&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347131#M114447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T00:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Parse JSON with “empty key”</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347132#M114448</link>
      <description>&lt;P&gt;Hi, your json is not valid :&lt;/P&gt;&lt;P&gt;after "abcd" and "pqr" you have comma , you have to delete them.&lt;/P&gt;&lt;P&gt;I can parse it :&lt;/P&gt;&lt;P&gt;I use a tfileinputraw to read the json file as a string (it create an object type) then i use a tconvertType to convert it as a string an then a textractjsonfield with read by JsonPath option:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Loop Jsonpathquery : "$"&lt;/P&gt;&lt;P&gt;&amp;nbsp;Mapping column : json query :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; firstname : "firstName"&lt;/P&gt;&lt;P&gt;type: "['phone.Numbers'][*].type"&lt;/P&gt;&lt;P&gt;empty : "['phone.Numbers'][*].['']"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Send me love and kudos&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 06:47:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347132#M114448</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-06-08T06:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Parse JSON with “empty key”</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347133#M114449</link>
      <description>&lt;P&gt;to get all the values :&lt;/P&gt;&lt;P&gt;i read a first time the json with these query :&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;LoopJsonpath query : "$"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;column : json query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;firstName : "firstName"&lt;/P&gt;&lt;P&gt;phone : "$.['phone.Numbers'][*]."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i use a tflowtoiterate to stock the value in globalmap and iterate each phone infos of the contact.&lt;/P&gt;&lt;P&gt;and i read again with textractjsonfield the phone string :&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;LoopJsonpath query : "$.[*]"&lt;/P&gt;&lt;P&gt;column : json query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type : "type"&lt;/P&gt;&lt;P&gt;number : "number"&lt;/P&gt;&lt;P&gt;empty : "['']"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and in a tjavarow i add the field i stock before in tflowtoiterate like firstName&lt;/P&gt;&lt;P&gt;ex : if i iterate row3 in my job :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output_row.firstName = ((String)globalMap.get("row3.firstName"));&lt;/P&gt;&lt;P&gt;output_row.type = input_row.type;&lt;/P&gt;&lt;P&gt;output_row.number = input_row.number;&lt;/P&gt;&lt;P&gt;output_row.empty = input_row.empty;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 07:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parse-JSON-with-empty-key/m-p/2347133#M114449</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-06-08T07:44:12Z</dc:date>
    </item>
  </channel>
</rss>

