<?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 How to convert json object to json array with twriteJsonField Component tried with attribute as array but not working in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-json-object-to-json-array-with-twriteJsonField/m-p/2363643#M127491</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As iam new to talend i started few ways to achieve the below output could you please guide me on the same :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my twriteJsonfield component is generating the response as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;	"tranid": "1212",&lt;/P&gt;&lt;P&gt;	"user": {&lt;/P&gt;&lt;P&gt;		"name": "123",&lt;/P&gt;&lt;P&gt;		"addr": "786 rt"&lt;/P&gt;&lt;P&gt;	},&lt;/P&gt;&lt;P&gt;   "loc": {&lt;/P&gt;&lt;P&gt;		"lction": "123",&lt;/P&gt;&lt;P&gt;		"state": "ind"&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but need the ouput json as follow :&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;	"tranid": "1212",&lt;/P&gt;&lt;P&gt;	"user": [{&lt;/P&gt;&lt;P&gt;		"name": "123",&lt;/P&gt;&lt;P&gt;		"addr": "786 rt"&lt;/P&gt;&lt;P&gt;	}],&lt;/P&gt;&lt;P&gt;   "loc": [{&lt;/P&gt;&lt;P&gt;		"lction": "123",&lt;/P&gt;&lt;P&gt;		"state": "ind"&lt;/P&gt;&lt;P&gt;	}]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eventhough the user attribute has single pair of values in the response i want them to be of type array (surrounded with square brackets)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know that twritejson field component will convert the same to array in case if we have more values , but in my case even though their is single value it should be surrounded with square brackets ([])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please guide me on the same ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my job flow :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   tdbinput --&amp;gt; tmap --&amp;gt; twritejsonfield (want to include square brackets for single objects too )--&amp;gt; kafkaout&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:47:48 GMT</pubDate>
    <dc:creator>HVasa1630039830</dc:creator>
    <dc:date>2024-11-15T23:47:48Z</dc:date>
    <item>
      <title>How to convert json object to json array with twriteJsonField Component tried with attribute as array but not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-convert-json-object-to-json-array-with-twriteJsonField/m-p/2363643#M127491</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As iam new to talend i started few ways to achieve the below output could you please guide me on the same :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my twriteJsonfield component is generating the response as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;	"tranid": "1212",&lt;/P&gt;&lt;P&gt;	"user": {&lt;/P&gt;&lt;P&gt;		"name": "123",&lt;/P&gt;&lt;P&gt;		"addr": "786 rt"&lt;/P&gt;&lt;P&gt;	},&lt;/P&gt;&lt;P&gt;   "loc": {&lt;/P&gt;&lt;P&gt;		"lction": "123",&lt;/P&gt;&lt;P&gt;		"state": "ind"&lt;/P&gt;&lt;P&gt;	}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but need the ouput json as follow :&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;	"tranid": "1212",&lt;/P&gt;&lt;P&gt;	"user": [{&lt;/P&gt;&lt;P&gt;		"name": "123",&lt;/P&gt;&lt;P&gt;		"addr": "786 rt"&lt;/P&gt;&lt;P&gt;	}],&lt;/P&gt;&lt;P&gt;   "loc": [{&lt;/P&gt;&lt;P&gt;		"lction": "123",&lt;/P&gt;&lt;P&gt;		"state": "ind"&lt;/P&gt;&lt;P&gt;	}]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eventhough the user attribute has single pair of values in the response i want them to be of type array (surrounded with square brackets)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know that twritejson field component will convert the same to array in case if we have more values , but in my case even though their is single value it should be surrounded with square brackets ([])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please guide me on the same ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my job flow :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   tdbinput --&amp;gt; tmap --&amp;gt; twritejsonfield (want to include square brackets for single objects too )--&amp;gt; kafkaout&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-convert-json-object-to-json-array-with-twriteJsonField/m-p/2363643#M127491</guid>
      <dc:creator>HVasa1630039830</dc:creator>
      <dc:date>2024-11-15T23:47:48Z</dc:date>
    </item>
  </channel>
</rss>

