<?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: how to ? : json array as well if single entry in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254861#M37745</link>
    <description>&lt;P&gt;Glad it could help.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please mark the topic as resolved so that it will help our Talend community members.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 13:04:37 GMT</pubDate>
    <dc:creator>iamabhishek</dc:creator>
    <dc:date>2018-10-11T13:04:37Z</dc:date>
    <item>
      <title>how to ? : json array as well if single entry</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254858#M37742</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;I'm trying to build a json with an array element,&lt;/P&gt; 
&lt;P&gt;when the field has multiple element : the json element is ok, it's an array as wanted...&lt;/P&gt; 
&lt;P&gt;but if the fied has a single entry... the element is turned as string and i would like it to stay a array with a single entry.&lt;/P&gt; 
&lt;P&gt;My exampel job look like that :&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fatherAndChild.png" style="width: 816px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0RA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149333i31BDF97F0BAED532/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0RA.png" alt="0683p000009M0RA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;its résult is :&lt;/P&gt; 
&lt;PRE&gt;.-------+-----------------.
|       show source       |
|=------+----------------=|
|Father |Child            |
|=------+----------------=|
|Pierre |Kevin,Jordy,Dylan|
|Paul   |Lorie,Alizé      |
|Jacques|Lana             |
'-------+-----------------'

.-------+-----.
|Child as row |
|=------+----=|
|Father |Child|
|=------+----=|
|Pierre |Kevin|
|Pierre |Jordy|
|Pierre |Dylan|
|Paul   |Lorie|
|Paul   |Alizé|
|Jacques|Lana |
'-------+-----'
.-----------------------------------------------------.
|                  children in array                  |
|=---------------------------------------------------=|
|json                                                 |
|=---------------------------------------------------=|
|{"Father":"Pierre","Child":["Kevin","Jordy","Dylan"]}|
|{"Father":"Paul","Child":["Lorie","Alizé"]}          |
|{"Father":"Jacques","Child":"Lana"}                  |
'-----------------------------------------------------'

.---------------------------------------------------------------------------------------------------------------------------------------.
|                                                                result                                                                 |
|=-------------------------------------------------------------------------------------------------------------------------------------=|
|json                                                                                                                                   |
|=-------------------------------------------------------------------------------------------------------------------------------------=|
|[{"Father":"Pierre","Child":["Kevin","Jordy","Dylan"]},{"Father":"Paul","Child":["Lorie","Alizé"]},{"Father":"Jacques","Child":"Lana"}]|
'---------------------------------------------------------------------------------------------------------------------------------------'&lt;/PRE&gt; 
&lt;P&gt;the json out is :&lt;/P&gt; 
&lt;PRE&gt;[
	{
		"Father": "Pierre",
		"Child": [
			"Kevin",
			"Jordy",
			"Dylan"
		]
	},
	{
		"Father": "Paul",
		"Child": [
			"Lorie",
			"Alizé"
		]
	},
	{
		"Father": "Jacques",
		"Child": "Lana"
	}
]&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;Lana is my problem ... i would like it to look like ["Lana"]&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;here is how i'have set the TWriteJSONFlied:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tWriteJSONField.png" style="width: 838px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0Mf.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147475iEE45BA04F885CAA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0Mf.png" alt="0683p000009M0Mf.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 11:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254858#M37742</guid>
      <dc:creator>iztoogood</dc:creator>
      <dc:date>2018-10-11T11:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to ? : json array as well if single entry</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254859#M37743</link>
      <description>&lt;P&gt;Under Child add Attribute - say give the name as class and assign a static value of&amp;nbsp;array.&lt;/P&gt; 
&lt;P&gt;Something like this -&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tWriteJSONFields-1.JPG" style="width: 444px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0RK.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150674iC631374BA5F3FF3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0RK.jpg" alt="0683p000009M0RK.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 12:08:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254859#M37743</guid>
      <dc:creator>iamabhishek</dc:creator>
      <dc:date>2018-10-11T12:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to ? : json array as well if single entry</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254860#M37744</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;Thanks for your help... starting with your advice, i've found how to deal with it !!!&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2018_10_11_13_57_56_tWriteJSONField_1.png" style="width: 741px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0RP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137710iB1A60B6C65605308/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0RP.png" alt="0683p000009M0RP.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;it gives exactly what i need :&lt;/P&gt; 
&lt;PRE&gt;.-----------------------------------------------------.
|                  children in array                  |
|=---------------------------------------------------=|
|json                                                 |
|=---------------------------------------------------=|
|{"Father":"Pierre","Child":["Kevin","Jordy","Dylan"]}|
|{"Father":"Paul","Child":["Lorie","Alizé"]}          |
|{"Father":"Jacques","Child":["Lana"]}                |
'-----------------------------------------------------'&lt;/PRE&gt; 
&lt;PRE&gt;[
	{
		"Father": "Pierre",
		"Child": [
			"Kevin",
			"Jordy",
			"Dylan"
		]
	},
	{
		"Father": "Paul",
		"Child": [
			"Lorie",
			"Alizé"
		]
	},
	{
		"Father": "Jacques",
		"Child": [
			"Lana"
		]
	}
]&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Oct 2018 13:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254860#M37744</guid>
      <dc:creator>iztoogood</dc:creator>
      <dc:date>2018-10-11T13:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to ? : json array as well if single entry</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254861#M37745</link>
      <description>&lt;P&gt;Glad it could help.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please mark the topic as resolved so that it will help our Talend community members.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 13:04:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-json-array-as-well-if-single-entry/m-p/2254861#M37745</guid>
      <dc:creator>iamabhishek</dc:creator>
      <dc:date>2018-10-11T13:04:37Z</dc:date>
    </item>
  </channel>
</rss>

