<?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: JSON Array values to Rows … is there a better way? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295656#M68406</link>
    <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp; &amp;lt;-- THANK YOU!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I could not figure out the syntax/combinations to make this happen.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Your solution not only demonstrated the answer, but you also explained it very clearly as well.&lt;/P&gt; 
&lt;P&gt;I had tried to create this kind of solution too. But I failed to figure out several of the details and moved on to trying other variations before I posted my question.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I learned from your reply:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) Having an output defined as a column without a "Json query" will allow an existing data element to "pass through" the tExtractJSONField component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I would have expect that condition to replace it with a null value (or BLOCK the element) instead of allowing it to pass through. But I guess my expectations are just not "Talend'ized" enough yet.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I really think it would make more sense if there was a special "passthrough from input" place holder value in the column table instead of a null column value. It would be so much more visual/clear if it said something instead of nothing. ( But maybe that is just me?&amp;nbsp; The text could even be displayed as "grayed out text" if needed. )&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2) JSON query to select the "current node" is an AT sign (&amp;nbsp;@ ).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I "speak" XPATH more than "Json query". So I would have guessed "." would have done that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; If it helps someone else (who speaks XPATH) ...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;REF:&amp;nbsp;&lt;A href="https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/LcNrhqdlyheCLpwyUwgJQw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/LcNrhqdlyheCLpwyUwgJQw&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; There is a linked ref to&amp;nbsp;&lt;A href="http://goessner.net/articles/JsonPath/&amp;nbsp;" target="_blank" rel="nofollow noopener noreferrer"&gt;http://goessner.net/articles/JsonPath/&amp;nbsp;&lt;/A&gt; ( But it looks like a "draft" more than a "standard".)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;3) I really hate the way the configuration of components in Talend sometimes need double quote, null values, or not those things. Depending on what you are trying to do.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; It almost seems like a "secret handshake" that I did not get a copy of the&amp;nbsp;handbook that explains all of those rules. It is very frustrating and is easily the most confusing part of the Talend UI IMHO.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Sat, 03 Mar 2018 04:52:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-03T04:52:57Z</dc:date>
    <item>
      <title>JSON Array values to Rows … is there a better way?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295654#M68404</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Using: Talend Open Studio v6.5.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a JSON data structure like this inside a larger data structure:&lt;/P&gt; 
&lt;PRE&gt;{
   "dataSet": [{
        "_item": {
           "user": "bob",
           "list_of_colors": ["Red", "Gray","Silver","Black","White","Green"]
        }
   }]
}&lt;/PRE&gt; 
&lt;P&gt;What I want from this part of the data structure are 6 rows like this:&lt;BR /&gt;bob,"Red"&lt;BR /&gt;bob,"Gray"&lt;BR /&gt;bob,"Silver"&lt;BR /&gt;bob,"Black"&lt;BR /&gt;bob,"White"&lt;BR /&gt;bob,"Green"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;However, I spent far too long getting to a “hack of a way” to do this. Maybe it is the only way to do this. If so, then use this as an example. But I hope there is a better way and someone can correct the sample project and let us all know. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; (AKA: What is the better way?)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Attached is a sample project that shows multiple attempts I tried to get this to work.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Please_fix: a definition of the problem&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;try1: using tExractPositionalFields&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;try2_take1: using tNormalize&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;try2_take2: using tMap&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;try2_take3_a_hack_that_works: tReplace and tNormalize&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope that helps. And thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 14:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295654#M68404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-28T14:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Array values to Rows … is there a better way?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295655#M68405</link>
      <description>&lt;P&gt;You just need to use two tExtractJSONField components to do this. I've done it very quickly to give you an idea.&lt;/P&gt; 
&lt;P&gt;The first tExtractJSONField is just used to get the user. The Loop is set to the first array and the Mappings simply get the user and the list_of_colorss array.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-03-01 at 13.20.08.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LsG2.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149532i8F40B6F09B096A3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LsG2.png" alt="0683p000009LsG2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The second tExtractJSONField is uses the "list_of_colours" data extracted by the first tExtractJSONFields component. The Loop is just over the array. In the Mapping the "user" field is just a pass-through. Leave it blank. The colour is just an "@" as it is the element being looped on.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-03-01 at 13.20.20.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lshd.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128489iB26220F8AFFE0407/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lshd.png" alt="0683p000009Lshd.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This will produce the data in the way you want.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 13:28:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295655#M68405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-01T13:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Array values to Rows … is there a better way?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295656#M68406</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp; &amp;lt;-- THANK YOU!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I could not figure out the syntax/combinations to make this happen.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Your solution not only demonstrated the answer, but you also explained it very clearly as well.&lt;/P&gt; 
&lt;P&gt;I had tried to create this kind of solution too. But I failed to figure out several of the details and moved on to trying other variations before I posted my question.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I learned from your reply:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) Having an output defined as a column without a "Json query" will allow an existing data element to "pass through" the tExtractJSONField component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I would have expect that condition to replace it with a null value (or BLOCK the element) instead of allowing it to pass through. But I guess my expectations are just not "Talend'ized" enough yet.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I really think it would make more sense if there was a special "passthrough from input" place holder value in the column table instead of a null column value. It would be so much more visual/clear if it said something instead of nothing. ( But maybe that is just me?&amp;nbsp; The text could even be displayed as "grayed out text" if needed. )&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2) JSON query to select the "current node" is an AT sign (&amp;nbsp;@ ).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I "speak" XPATH more than "Json query". So I would have guessed "." would have done that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; If it helps someone else (who speaks XPATH) ...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;REF:&amp;nbsp;&lt;A href="https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/LcNrhqdlyheCLpwyUwgJQw" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/LcNrhqdlyheCLpwyUwgJQw&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; There is a linked ref to&amp;nbsp;&lt;A href="http://goessner.net/articles/JsonPath/&amp;nbsp;" target="_blank" rel="nofollow noopener noreferrer"&gt;http://goessner.net/articles/JsonPath/&amp;nbsp;&lt;/A&gt; ( But it looks like a "draft" more than a "standard".)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;3) I really hate the way the configuration of components in Talend sometimes need double quote, null values, or not those things. Depending on what you are trying to do.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; It almost seems like a "secret handshake" that I did not get a copy of the&amp;nbsp;handbook that explains all of those rules. It is very frustrating and is easily the most confusing part of the Talend UI IMHO.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2018 04:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295656#M68406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-03T04:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Array values to Rows … is there a better way?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295657#M68407</link>
      <description>&lt;P&gt;Hi @Richard Hall​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Came across this answer when trying to do something similar with a JSON structure that was just a JSON Array, with inner JSON Arrays - worked perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 07:20:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-values-to-Rows-is-there-a-better-way/m-p/2295657#M68407</guid>
      <dc:creator>David_Beaty</dc:creator>
      <dc:date>2020-11-03T07:20:39Z</dc:date>
    </item>
  </channel>
</rss>

