<?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 JSONObject incorrect ordering in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362049#M126258</link>
    <description>&lt;P&gt;This is my tjavarow: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JSONObject finalJson = new JSONObject();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finalJson.put("A", input_row.A);&lt;/P&gt;&lt;P&gt;finalJson.put("BId", input_row.BId);&lt;/P&gt;&lt;P&gt;finalJson.put("status", input_row.status);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;globalMap.put("finalJson", finalJson.toString());&lt;/P&gt;&lt;P&gt;System.out.println("finalJson: " + finalJson.toString());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my tlog row is :&lt;/P&gt;&lt;P&gt;{"BId":"AB123","A":"","status":"Approved"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead it should have looked like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"A":"","BId":"AB123","status":"Approved"}  --How can I achieve this. The log row iam getting doesnt have correct ordering &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 21:19:46 GMT</pubDate>
    <dc:creator>NNayal1600240775</dc:creator>
    <dc:date>2024-11-15T21:19:46Z</dc:date>
    <item>
      <title>JSONObject incorrect ordering</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362049#M126258</link>
      <description>&lt;P&gt;This is my tjavarow: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JSONObject finalJson = new JSONObject();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finalJson.put("A", input_row.A);&lt;/P&gt;&lt;P&gt;finalJson.put("BId", input_row.BId);&lt;/P&gt;&lt;P&gt;finalJson.put("status", input_row.status);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;globalMap.put("finalJson", finalJson.toString());&lt;/P&gt;&lt;P&gt;System.out.println("finalJson: " + finalJson.toString());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my tlog row is :&lt;/P&gt;&lt;P&gt;{"BId":"AB123","A":"","status":"Approved"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But instead it should have looked like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"A":"","BId":"AB123","status":"Approved"}  --How can I achieve this. The log row iam getting doesnt have correct ordering &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362049#M126258</guid>
      <dc:creator>NNayal1600240775</dc:creator>
      <dc:date>2024-11-15T21:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSONObject incorrect ordering</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362050#M126259</link>
      <description>&lt;P&gt;Hi @Neha Nayal​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since a JSON object is described as "an unordered set of name/value pairs" (https://www.json.org/json-en.html), this is an expected behavior from a JSON library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you need to have an ordered JSON, it seems you can achieve it using a LinkedHashMap object or JsonObject class from com.google.gson.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please take a look at this for reference: https://stackoverflow.com/questions/3948206/json-order-mixed-up&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362050#M126259</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-10-17T12:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: JSONObject incorrect ordering</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362051#M126260</link>
      <description>&lt;P&gt;The order of the attributes are irrelevant! The component suite: tJSONDoc* (https://github.com/jlolling/talendcomp_tJSONDoc) keeps the order of the attributes because the underlaying lib does this. But again, it does not matter!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 10:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSONObject-incorrect-ordering/m-p/2362051#M126260</guid>
      <dc:creator>jlolling</dc:creator>
      <dc:date>2023-10-19T10:03:01Z</dc:date>
    </item>
  </channel>
</rss>

