<?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 a JSON Array for rows in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Create-a-JSON-Array-for-rows/m-p/2346005#M113457</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have designed a job with a loop which is getting some database-data as rows. I want to transform these data into an jsonarray.&lt;/P&gt;&lt;P&gt;The JSON should look similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"},{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to achieve this by following the instructions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.talend.com/r/en-US/8.0/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-converting-rows-to-json-array-to" target="_blank"&gt;https://help.talend.com/r/en-US/8.0/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-converting-rows-to-json-array-to&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is working fine as long as I have some input with more than one row. Since i can not guarantee that there will always be more then one row (remember I'm doing a loop with many iterations)  I need an approach which also works for one row.&lt;/P&gt;&lt;P&gt;If i have only one row as input I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"loop":{"coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I'd like to achieve is an array with only one object:&lt;/P&gt;&lt;P&gt;[{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the any recommendations how to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Janina&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 22:07:30 GMT</pubDate>
    <dc:creator>JGuttmann1675784205</dc:creator>
    <dc:date>2024-11-15T22:07:30Z</dc:date>
    <item>
      <title>Create a JSON Array for rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-a-JSON-Array-for-rows/m-p/2346005#M113457</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have designed a job with a loop which is getting some database-data as rows. I want to transform these data into an jsonarray.&lt;/P&gt;&lt;P&gt;The JSON should look similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"},{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to achieve this by following the instructions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.talend.com/r/en-US/8.0/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-converting-rows-to-json-array-to" target="_blank"&gt;https://help.talend.com/r/en-US/8.0/processing/twritejsonfield-tmap-trowgenerator-trowgenerator-converting-rows-to-json-array-to&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is working fine as long as I have some input with more than one row. Since i can not guarantee that there will always be more then one row (remember I'm doing a loop with many iterations)  I need an approach which also works for one row.&lt;/P&gt;&lt;P&gt;If i have only one row as input I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"loop":{"coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I'd like to achieve is an array with only one object:&lt;/P&gt;&lt;P&gt;[{coding":"182321|155246|6843-6900,183670-1597:2296","catalogNumber":"602","validAt":"2022-09-30"}]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the any recommendations how to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Janina&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:07:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-a-JSON-Array-for-rows/m-p/2346005#M113457</guid>
      <dc:creator>JGuttmann1675784205</dc:creator>
      <dc:date>2024-11-15T22:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a JSON Array for rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-a-JSON-Array-for-rows/m-p/2346006#M113458</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Take a look at this &lt;A href="https://community.talend.com/s/feed/0D53p00007vCmHaCAK" alt="https://community.talend.com/s/feed/0D53p00007vCmHaCAK" target="_blank"&gt;topic&lt;/A&gt;,  phancongphuoc has the same issue and he suggested a workaround. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 13:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-a-JSON-Array-for-rows/m-p/2346006#M113458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-09T13:35:12Z</dc:date>
    </item>
  </channel>
</rss>

