<?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: Multiple MySQL tables to nested JSON in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202992#M4488</link>
    <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Have you already checked component:&lt;A href="https://help.talend.com/search/all?query=tWriteJSONField&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;TalendHelpCenter:tWriteJSONField&lt;/A&gt; which transforms the incoming data into JSON fields?&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi Sabrina, yeah, I found that late last night and then setting the "Group by" column to the order ID, and the loop in the tree, I was able to get everything working. Still some regex to do before the output is useful in an tHttpRequest POST (which now suffers from 
&lt;A href="https://jira.talendforge.org/browse/TDI-31574)" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-31574)&lt;/A&gt;, but definitely past the hurdle. 
&lt;BR /&gt;This was one of those, spend 4h trying to figure it out, post to the forum, and then figure it out. sigh. Appreciate the help as always.
&lt;BR /&gt;Cheers,</description>
    <pubDate>Thu, 16 Apr 2015 13:47:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-16T13:47:30Z</dc:date>
    <item>
      <title>Multiple MySQL tables to nested JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202990#M4486</link>
      <description>Hello,
&lt;BR /&gt;Is there an example somewhere for joining two mysql tables into a nested JSON file? Basically what I am trying to do is take an orders table, and an order_items table and combine them into a single JSON file, but where things run into issues is the 1:n relationship between orders and order_items. 
&lt;BR /&gt;As a very basic example:
&lt;BR /&gt;ORDER
&lt;BR /&gt;--------------
&lt;BR /&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; | USER_ID
&lt;BR /&gt;--------------
&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; | 123
&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; | 456
&lt;BR /&gt;
&lt;BR /&gt;ORDER_ITEM
&lt;BR /&gt;---------------------------
&lt;BR /&gt;ID &amp;nbsp;&amp;nbsp;&amp;nbsp; | ORDER_ID&amp;nbsp;&amp;nbsp;&amp;nbsp; | SKU
&lt;BR /&gt;---------------------------
&lt;BR /&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp; | 1&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; | ABCDE
&lt;BR /&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; | ABCDE
&lt;BR /&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp; | 2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; | FGHIJ
&lt;BR /&gt;
&lt;BR /&gt;OUTPUT:
&lt;BR /&gt;orderID: 1
&lt;BR /&gt;userID: 123
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemID: 10
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemSKU: ABCDE
&lt;BR /&gt;orderID: 2
&lt;BR /&gt;userID: 456
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemID: 11
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemSKU: ABCDE
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemID: 12
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderItemSKU: FGHIJ&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;
&lt;BR /&gt;JSON is ideal, but if this can be done in XML and converted to JSON that would work too. 
&lt;BR /&gt;Appreciate the help!</description>
      <pubDate>Wed, 15 Apr 2015 17:05:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202990#M4486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-15T17:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MySQL tables to nested JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202991#M4487</link>
      <description>Hi,&lt;BR /&gt;Have you already checked component:&lt;A href="https://help.talend.com/search/all?query=tWriteJSONField&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;TalendHelpCenter:tWriteJSONField&lt;/A&gt; which transforms the incoming data into JSON fields?&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Thu, 16 Apr 2015 05:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202991#M4487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-16T05:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MySQL tables to nested JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202992#M4488</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Have you already checked component:&lt;A href="https://help.talend.com/search/all?query=tWriteJSONField&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;TalendHelpCenter:tWriteJSONField&lt;/A&gt; which transforms the incoming data into JSON fields?&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi Sabrina, yeah, I found that late last night and then setting the "Group by" column to the order ID, and the loop in the tree, I was able to get everything working. Still some regex to do before the output is useful in an tHttpRequest POST (which now suffers from 
&lt;A href="https://jira.talendforge.org/browse/TDI-31574)" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-31574)&lt;/A&gt;, but definitely past the hurdle. 
&lt;BR /&gt;This was one of those, spend 4h trying to figure it out, post to the forum, and then figure it out. sigh. Appreciate the help as always.
&lt;BR /&gt;Cheers,</description>
      <pubDate>Thu, 16 Apr 2015 13:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202992#M4488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-16T13:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MySQL tables to nested JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202993#M4489</link>
      <description>Follow-up related to the tWriteJSONField... Is it possible to force arrays (other than a brutal regex hack)? 
&lt;BR /&gt;For example, there is a loop for the "options" object which builds an options array: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;"options":&lt;/PRE&gt; 
&lt;BR /&gt;When there is only one option however, it outputs: 
&lt;BR /&gt; 
&lt;PRE&gt;"options":{"name":"Colour","value":"Brown"}&lt;/PRE&gt; 
&lt;BR /&gt;Is it possible to force this?: 
&lt;BR /&gt; 
&lt;PRE&gt;"options":&lt;/PRE&gt; 
&lt;BR /&gt;The API where this JSON is eventually used is kicking back the following error and I'm not sure how to get around it: 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;&lt;FONT color="#993333"&gt;Cannot deserialize the current JSON object because the type requires a JSON array (e.g. ) to deserialize correctly.&lt;/FONT&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 16 Apr 2015 22:11:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-MySQL-tables-to-nested-JSON/m-p/2202993#M4489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-16T22:11:20Z</dc:date>
    </item>
  </channel>
</rss>

