<?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: Any good tWriteJSONField tutorials? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276769#M52755</link>
    <description>Hi Phil&lt;BR /&gt;&lt;BR /&gt;This looks like the kind of thing I need to do. Do you have any screenshots showing how to work through your steps, please?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Dave</description>
    <pubDate>Wed, 11 Dec 2019 08:11:28 GMT</pubDate>
    <dc:creator>davechurchley</dc:creator>
    <dc:date>2019-12-11T08:11:28Z</dc:date>
    <item>
      <title>Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276758#M52744</link>
      <description>&lt;P&gt;I'm struggling with anything more than a very simple JSON structure. I can create a JSON that has one array element in it, but as soon as it needs anything more (e.g. an&amp;nbsp;array of questions, each one of which contains an array of answers) I get lost. Are there any good examples of building complex JSON structures with tWriteJSONField components?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:21:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276758#M52744</guid>
      <dc:creator>PhilHibbs</dc:creator>
      <dc:date>2019-01-08T14:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276759#M52745</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/0053p000006dyyJAAQ"&gt;@PhilHibbs&lt;/A&gt;, I struggle all the time with this component. Infact, I too just posted another q with some additional specifics I am trying to achieve.
&lt;BR /&gt;I hope some experts can help us here!
&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 08 Jan 2019 16:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276759#M52745</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2019-01-08T16:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276760#M52746</link>
      <description>I'd echo that. Can't seem to create a JSON and call the application APIs. This component is probably super broken. None of my questions on the forum ever got answered.</description>
      <pubDate>Tue, 08 Jan 2019 20:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276760#M52746</guid>
      <dc:creator>sushantV</dc:creator>
      <dc:date>2019-01-08T20:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276761#M52747</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using the subscription version, perhaps you can take a look to the TalendDataMapper.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 21:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276761#M52747</guid>
      <dc:creator>yome1</dc:creator>
      <dc:date>2019-01-08T21:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276762#M52748</link>
      <description>&lt;P&gt;Ok here's my quick notes after some experimentation.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1. For each array in a JSON object, you need a tWriteJSONField component.&lt;/P&gt; 
&lt;P&gt;2. To build the array:&lt;/P&gt; 
&lt;P&gt;2a. Add elements for the aggregation key, and set the aggregation key in the Component properties&lt;/P&gt; 
&lt;P&gt;2b. Add a named element to hold the array, give it a &lt;EM&gt;class&lt;/EM&gt; attribute of &lt;EM&gt;array&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;2c. Add an element whose name is not important, give it a &lt;EM&gt;class&lt;/EM&gt; attribute of &lt;EM&gt;object&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;2d. Set the unnamed object element to be the loop element&lt;/P&gt; 
&lt;P&gt;3. Follow up immediately with a tExtractJSONField component with a Loop Jsonpath query of "$"&lt;/P&gt; 
&lt;P&gt;4. Map the aggregation key element(s) and the array element into output fields&lt;/P&gt; 
&lt;P&gt;Now you have the key fields, and the array in a string. You can then join this flow to other flows for other sets of data, and further build up your JSON in more tWriteJSONField components.&lt;/P&gt; 
&lt;P&gt;The one peculiar thing that baffles me is, the array that you get out from the tExtractJSONField is a string. Normally, when you map a string into a JSON element, it wraps it in quotes. So if the Name column contains Fred, you get this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;"Name":"Fred"&lt;/PRE&gt; 
&lt;P&gt;However, when you map the constructed array to a JSON element, you get something like this, which is exactly what is wanted:&lt;/P&gt; 
&lt;PRE&gt;"Children":[{"Name":"Alice","Age":7},{"Name":"Bob","Age":5},{"Name":"Carole","Age":1}]&lt;/PRE&gt; 
&lt;P&gt;What I expected to see was this:&lt;/P&gt; 
&lt;PRE&gt;"Children":"[{\"Name\":\"Alice\",\"Age\":7},{\"Name\":\"Bob\",\"Age\":5},{\"Name\":\"Carole\",\"Age\":1}]"&lt;/PRE&gt; 
&lt;P&gt;Can anyone explain why it is doing what I actually want, rather than what I expected it to do?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 13:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276762#M52748</guid>
      <dc:creator>PhilHibbs</dc:creator>
      <dc:date>2019-01-14T13:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276763#M52749</link>
      <description>&lt;P&gt;Yeah, Talend is supposed to be user-friendly but trust me, do yourself a favor and use an org.json.JSONObject instead. Now that I think about all the time I spent figuring out how to this very simple thing in Talend without real documentation (because you know, they need to work more on that), I could have developed a very sophisticated solution using pure java.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 11:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276763#M52749</guid>
      <dc:creator>navds</dc:creator>
      <dc:date>2019-01-16T11:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276764#M52750</link>
      <description>&lt;P&gt;I'd echo navds comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anything more than a simple/flat JSON structure, construct it yourself, making copious use of tHashInput/Output components to store the constructed JSON as an object and tAggregateRow in LIST(Object) method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 12:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276764#M52750</guid>
      <dc:creator>David_Beaty</dc:creator>
      <dc:date>2019-01-16T12:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276765#M52751</link>
      <description>&lt;P&gt;Thanks.Could you share a quick example of using &lt;SPAN&gt;org.json.JSONObject with this type of setup? I am not very savvy with using custom java code in tflex/ tjavarow. A quick&amp;nbsp;rundown on how to work through the flows to make the json object will be helpful please.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:02:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276765#M52751</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2019-01-17T13:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276766#M52752</link>
      <description>wow, thats neat. But, for me, I just discovered that tWriteJsonField would create an array instead of an object when single row is returned... This is baffling.</description>
      <pubDate>Thu, 17 Jan 2019 13:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276766#M52752</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2019-01-17T13:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276767#M52753</link>
      <description>Would you be able to share some examples of how to work with this? I am currently in the process of overhauling our web services served via ESB, and would love to learn how to create objects using pure java in Talend. A simple rundown with screenshots or something is appreciated. Thanks.</description>
      <pubDate>Thu, 17 Jan 2019 13:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276767#M52753</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2019-01-17T13:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276768#M52754</link>
      <description>&lt;P&gt;Maybe someone has a better technique but I don't like to use dozens of tLibraryLoad to import external jars. I prefer adding it in routine dependencies. In this basic example, I downloaded manually the jar json-20171018.jar (yeah, I wish this could be done project-wide using maven), created a new routine 'Demo', edit routine libraries to add the jar. Now I have a JSON parser&amp;nbsp;which could be used project-wise. Here, I returned a java.util.Map which should be familiar.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2019-01-17 16-53-27.png" style="width: 373px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M23j.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137706i2A9BC95D17D08A2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M23j.png" alt="0683p000009M23j.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="browse on your computer" style="width: 633px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M23t.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132345i326B3C4785EA5269/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M23t.png" alt="0683p000009M23t.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;browse on your computer&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="demo_routine_json.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1yL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152904i0F8914F2484602EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1yL.png" alt="0683p000009M1yL.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:49:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276768#M52754</guid>
      <dc:creator>navds</dc:creator>
      <dc:date>2019-01-17T14:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276769#M52755</link>
      <description>Hi Phil&lt;BR /&gt;&lt;BR /&gt;This looks like the kind of thing I need to do. Do you have any screenshots showing how to work through your steps, please?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Dave</description>
      <pubDate>Wed, 11 Dec 2019 08:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276769#M52755</guid>
      <dc:creator>davechurchley</dc:creator>
      <dc:date>2019-12-11T08:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276770#M52756</link>
      <description>OK, I've got this working now using a tMap instead of the tExtractJSONField component.</description>
      <pubDate>Fri, 13 Dec 2019 13:15:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276770#M52756</guid>
      <dc:creator>davechurchley</dc:creator>
      <dc:date>2019-12-13T13:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Any good tWriteJSONField tutorials?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276771#M52757</link>
      <description>&lt;P&gt;how have you done it?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 18:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Any-good-tWriteJSONField-tutorials/m-p/2276771#M52757</guid>
      <dc:creator>Nordom_LH</dc:creator>
      <dc:date>2020-02-27T18:30:40Z</dc:date>
    </item>
  </channel>
</rss>

