<?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: [resolved] Reading JSON with nested arrays in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236127#M24955</link>
    <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi&lt;BR /&gt;Read&amp;nbsp;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;categories node as a data and then you can use tExtractJsonField to extract data from the array.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi Shong, 
&lt;BR /&gt;I can read the categories node in using a separate input component, but I'm trying to avoid having to load the same file twice as I have to iterate over a number of records for this. 
&lt;BR /&gt;I've been able to extract the node using the extractJSON component but I need to join it back to the main data too. 
&lt;BR /&gt;The tMap component won't allow me to join this back to the main data, as I'm guessing it will only take input from two separate streams of data? There has to be a better way to essentially flatten a JSON with a nested array? 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBVi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133490i6437FCA856E13B0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBVi.png" alt="0683p000009MBVi.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Fri, 05 Dec 2014 13:15:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-12-05T13:15:52Z</dc:date>
    <item>
      <title>[resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236122#M24950</link>
      <description>Hi guys, 
&lt;BR /&gt;I'm trying to read in a file that has the following format: 
&lt;BR /&gt; 
&lt;PRE&gt;&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;"productId": "9876",&lt;BR /&gt; &amp;nbsp;"name": "Test 2",&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;BR /&gt; &amp;nbsp;"categories": &lt;BR /&gt;}&lt;BR /&gt;]&lt;/PRE&gt; 
&lt;BR /&gt;I've used the tFileInputJSON to read in the data and productId and name fields are read perfectly. &amp;nbsp;However, I can't seem to be able to read the categories array onto each record, or at the very least, a way to normalize it so that each record has one category? I originally tried selecting the "Get Nodes" checkbox, but it only ever outputs one value for the categories field and not all of them. 
&lt;BR /&gt;I've tried a number of other things but can't seem to get this to work. 
&lt;BR /&gt;Help please? 
&lt;BR /&gt;Thanks! 
&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 02 Dec 2014 04:32:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236122#M24950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T04:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236123#M24951</link>
      <description>Hi Chris, 
&lt;BR /&gt;JSON data given above is not getting parsed correctly ( 
&lt;A href="http://json.parser.online.fr/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://json.parser.online.fr/&lt;/A&gt;) 
&lt;BR /&gt;... what is the significance of data inside last two square brackets ? 
&lt;BR /&gt;Vaibhav</description>
      <pubDate>Tue, 02 Dec 2014 05:13:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236123#M24951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T05:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236124#M24952</link>
      <description>Hi, 
&lt;BR /&gt;Sorry, not sure how those two got in there as it's not supposed to be there. &amp;nbsp;&amp;nbsp; 
&lt;FONT size="2"&gt;I've updated it now to remove them.&lt;/FONT&gt; 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 02 Dec 2014 05:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236124#M24952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-02T05:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236125#M24953</link>
      <description>Hi, 
&lt;BR /&gt;Can anyone help me with this? 
&lt;BR /&gt;There must be a way to parse out nested arrays from a JSON without having to read the file in more than once? 
&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 04 Dec 2014 15:53:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236125#M24953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T15:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236126#M24954</link>
      <description>Hi 
&lt;BR /&gt;Read&amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;categories node as a data and then you can use tExtractJsonField to extract data from the array.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 05 Dec 2014 01:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236126#M24954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-05T01:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236127#M24955</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi&lt;BR /&gt;Read&amp;nbsp;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;categories node as a data and then you can use tExtractJsonField to extract data from the array.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi Shong, 
&lt;BR /&gt;I can read the categories node in using a separate input component, but I'm trying to avoid having to load the same file twice as I have to iterate over a number of records for this. 
&lt;BR /&gt;I've been able to extract the node using the extractJSON component but I need to join it back to the main data too. 
&lt;BR /&gt;The tMap component won't allow me to join this back to the main data, as I'm guessing it will only take input from two separate streams of data? There has to be a better way to essentially flatten a JSON with a nested array? 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBVi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133490i6437FCA856E13B0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBVi.png" alt="0683p000009MBVi.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 05 Dec 2014 13:15:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236127#M24955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-05T13:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236128#M24956</link>
      <description>So what I've done now instead is to do&amp;nbsp;&lt;BR /&gt;tFileInputJSON --&amp;gt; tExtractJSONFields&lt;BR /&gt;and set the Loop XPath query to be "/categories" and specify XPath query appropriately for every other attribute.&lt;BR /&gt;However, this works well for when I have just the one nested attribute. &amp;nbsp;Is there a better way to do this if there is another nested attribute besides running an extract json for every nested attribute?</description>
      <pubDate>Thu, 11 Dec 2014 16:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236128#M24956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-11T16:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Reading JSON with nested arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236129#M24957</link>
      <description>&lt;P&gt;Hi&lt;/P&gt; 
&lt;PRE&gt;The tMap component won't allow me to join this back to the main data, as I'm guessing it will only take input from two separate streams of data? There has to be a better way to essentially flatten a JSON with a nested array?&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Take a look at this &lt;A href="https://community.qlik.com/s/article/ka03p0000006EZYAA2" target="_blank"&gt;article&lt;/A&gt;to know why it is not allowed. You have to redesign the job like:&lt;BR /&gt;main job:&lt;BR /&gt;tFileList--iterate--tRunJob&lt;BR /&gt;pass the current file path the child job.&lt;BR /&gt;child job:&lt;BR /&gt;tFileInputJson--main--tReplicate--main.....tHashOutput&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --main--...tHashOutput&lt;BR /&gt;&amp;nbsp; &amp;nbsp; |&lt;BR /&gt;onsubjobok&lt;BR /&gt;&amp;nbsp; &amp;nbsp; |&lt;BR /&gt;tHashInput....tMap---&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lookup&amp;nbsp;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tHashInput&lt;/FONT&gt;&lt;BR /&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 09:36:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Reading-JSON-with-nested-arrays/m-p/2236129#M24957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-12T09:36:03Z</dc:date>
    </item>
  </channel>
</rss>

