<?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 create json array with and without field names in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/create-json-array-with-and-without-field-names/m-p/2268081#M46762</link>
    <description>&lt;P&gt;Scenario 1: Create nested json with field names&lt;/P&gt;
&lt;P&gt;Expected result;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"rootTag": {&lt;BR /&gt;"newColumns1": "A",&lt;BR /&gt;"newColumn2": "B",&lt;BR /&gt;"&lt;STRONG&gt;SUB&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "C",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "K",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "L"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "E",&lt;BR /&gt;"newColumn4": "F",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "M",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "N"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "G",&lt;BR /&gt;"newColumn4": "H",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "O",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "P"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "X",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "Q",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "R"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "Y",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;"NewCol5": "S",&lt;BR /&gt;"NewCol6": "T"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scenario 2: Created nested json array where the second level should not have field names.&lt;BR /&gt;Expected result.&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"rootTag": {&lt;BR /&gt;"newColumns1": "A",&lt;BR /&gt;"newColumn2": "B",&lt;BR /&gt;"&lt;STRONG&gt;SUB&lt;/STRONG&gt;": [{&lt;BR /&gt;"newColumn3": "C",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["K", "L"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "E",&lt;BR /&gt;"newCol4": "F",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["M", "N"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "G",&lt;BR /&gt;"newCol4": "H",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["O", "P"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "X",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["Q", "R"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "Y",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["S", "T"]&lt;/STRONG&gt;&lt;BR /&gt;}]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:28:22 GMT</pubDate>
    <dc:creator>Aami</dc:creator>
    <dc:date>2024-11-16T03:28:22Z</dc:date>
    <item>
      <title>create json array with and without field names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/create-json-array-with-and-without-field-names/m-p/2268081#M46762</link>
      <description>&lt;P&gt;Scenario 1: Create nested json with field names&lt;/P&gt;
&lt;P&gt;Expected result;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"rootTag": {&lt;BR /&gt;"newColumns1": "A",&lt;BR /&gt;"newColumn2": "B",&lt;BR /&gt;"&lt;STRONG&gt;SUB&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "C",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "K",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "L"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "E",&lt;BR /&gt;"newColumn4": "F",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "M",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "N"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "G",&lt;BR /&gt;"newColumn4": "H",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "O",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "P"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "X",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "Q",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "R"&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"newColumn3": "Y",&lt;BR /&gt;"newColumn4": "D",&lt;BR /&gt;"&lt;STRONG&gt;SUB2&lt;/STRONG&gt;": [&lt;BR /&gt;{&lt;BR /&gt;"NewCol5": "S",&lt;BR /&gt;"NewCol6": "T"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scenario 2: Created nested json array where the second level should not have field names.&lt;BR /&gt;Expected result.&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"rootTag": {&lt;BR /&gt;"newColumns1": "A",&lt;BR /&gt;"newColumn2": "B",&lt;BR /&gt;"&lt;STRONG&gt;SUB&lt;/STRONG&gt;": [{&lt;BR /&gt;"newColumn3": "C",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["K", "L"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "E",&lt;BR /&gt;"newCol4": "F",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["M", "N"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "G",&lt;BR /&gt;"newCol4": "H",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["O", "P"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "X",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["Q", "R"]&lt;/STRONG&gt;&lt;BR /&gt;}, {&lt;BR /&gt;"newColumn3": "Y",&lt;BR /&gt;"newCol4": "D",&lt;BR /&gt;&lt;STRONG&gt;"SUB2": ["S", "T"]&lt;/STRONG&gt;&lt;BR /&gt;}]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:28:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/create-json-array-with-and-without-field-names/m-p/2268081#M46762</guid>
      <dc:creator>Aami</dc:creator>
      <dc:date>2024-11-16T03:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: create json array with and without field names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/create-json-array-with-and-without-field-names/m-p/2268082#M46763</link>
      <description>&lt;P&gt;The sample job structure is as shown below.&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="JOB_STRUCTURE.PNG" style="width: 318px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8rj.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151363i1D93820F517E925A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8rj.png" alt="0683p000009M8rj.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; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the fixed flow input I am using inline table to populate some sample data.&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Input.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8qr.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132333i891118D16E6BCC1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8qr.png" alt="0683p000009M8qr.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Lets see the settings from tWriteJsonField. The group by option should be used to to group the values. Here Im considering Col1 &amp;amp; 2 as group by.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="GroupBy.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8ry.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147562iEEC3432F2AD5374F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8ry.png" alt="0683p000009M8ry.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; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The above steps are common for both scenario 1 &amp;amp; 2.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Scenario 1:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;The columns 1&amp;amp; 2 are the group by ones and they will have sub elemnets 3 &amp;amp; 4 and 4 will further have sub elements 5 &amp;amp; 6. After adding the first sub element "&lt;STRONG&gt;&lt;EM&gt;SUB&lt;/EM&gt;&lt;/STRONG&gt;" add a &lt;STRONG&gt;&lt;EM&gt;class&lt;/EM&gt; &lt;/STRONG&gt;attribute and set the fixed value to array. Under the &lt;STRONG&gt;&lt;EM&gt;SUB&lt;/EM&gt; &lt;/STRONG&gt;add next sub element as &lt;EM&gt;&lt;STRONG&gt;element&lt;/STRONG&gt; &lt;/EM&gt;and set it as loop element. Under this element add another attribute&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;class&lt;/EM&gt;&lt;/STRONG&gt; and set the value to &lt;EM&gt;&lt;STRONG&gt;object.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;Under element add next sub elements (In this case column 3 &amp;amp; 4).&lt;/P&gt; 
&lt;P&gt;Now the first nest is done.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For the next one, create another sub element "&lt;EM&gt;&lt;STRONG&gt;SUB2&lt;/STRONG&gt;&lt;/EM&gt;" and proceed with the same steps.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This will give the output with field names.&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;SUB2": [&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol5": "K",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"NewCol6": "L"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json_Scenario1.PNG" style="width: 656px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8i5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134196i0DD6DF820F1D8F08/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8i5.png" alt="0683p000009M8i5.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Scenario 2:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;The columns 1&amp;amp; 2 are the group by ones and they will have sub elemnets 3 &amp;amp; 4 and 4 will further have sub elements 5 &amp;amp; 6. After adding the first sub element "&lt;STRONG&gt;&lt;EM&gt;SUB&lt;/EM&gt;&lt;/STRONG&gt;" add a &lt;STRONG&gt;&lt;EM&gt;class&lt;/EM&gt; &lt;/STRONG&gt;attribute and set the fixed value to array. Under the &lt;STRONG&gt;&lt;EM&gt;SUB&lt;/EM&gt; &lt;/STRONG&gt;add next sub element as &lt;EM&gt;&lt;STRONG&gt;element&lt;/STRONG&gt; &lt;/EM&gt;and set it as loop element. Under element add next sub elements (In this case column 3 &amp;amp; 4).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;Do not add the object attribute in this case and skip adding &lt;STRONG&gt;element&amp;nbsp;&lt;/STRONG&gt;under the sub for which you dont need the headers(in this case SUB2)&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;Now the first nest is done.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For the next one, create another sub element "&lt;EM&gt;&lt;STRONG&gt;SUB2&lt;/STRONG&gt;&lt;/EM&gt;" and proceed with the same steps but will skip adding the sub element "element".&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This will give the output without the field names.&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;"SUB2": ["K", "L"]&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="json_Scenario2.PNG" style="width: 799px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8s3.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129379i0D5BED5CEAFCD074/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8s3.png" alt="0683p000009M8s3.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 07:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/create-json-array-with-and-without-field-names/m-p/2268082#M46763</guid>
      <dc:creator>Aami</dc:creator>
      <dc:date>2020-01-24T07:35:40Z</dc:date>
    </item>
  </channel>
</rss>

