<?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: [resolved] Empty/Null fields show up in json output twritejsonfield in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265423#M44975</link>
    <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I have a flow going into tWriteJsonFIELD which creates an array&lt;BR /&gt;{docs:}&lt;BR /&gt;However, if lets say the date is missing in one of the fields, it looks like this:&lt;BR /&gt;{docs:}&lt;BR /&gt;]}&lt;BR /&gt;Which is not what I want. If the field is empty/null I do not want it to show up in the output at all, like so:&lt;BR /&gt;{docs:}&lt;BR /&gt;Does anyone have any advice or ideas on how I can achieve this?&lt;BR /&gt;Thank you!&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi,
&lt;BR /&gt;How did you achieve the below using the twriteJson, Please assist.&amp;nbsp;
&lt;BR /&gt;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;{docs:}&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;BR /&gt;Thanks,</description>
    <pubDate>Thu, 03 Nov 2016 23:49:27 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2016-11-03T23:49:27Z</dc:date>
    <item>
      <title>[resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265416#M44968</link>
      <description>I have a flow going into tWriteJsonFIELD which creates an array
&lt;BR /&gt;{docs:}
&lt;BR /&gt;However, if lets say the date is missing in one of the fields, it looks like this:
&lt;BR /&gt;{docs:}
&lt;BR /&gt;]}
&lt;BR /&gt;Which is not what I want. If the field is empty/null I do not want it to show up in the output at all, like so:
&lt;BR /&gt;{docs:}
&lt;BR /&gt;Does anyone have any advice or ideas on how I can achieve this?
&lt;BR /&gt;Thank you!</description>
      <pubDate>Tue, 15 Jan 2013 20:30:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265416#M44968</guid>
      <dc:creator>jkrfs</dc:creator>
      <dc:date>2013-01-15T20:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265417#M44969</link>
      <description>Hi 
&lt;BR /&gt;It is impossible to generate the result as you expected by modifying anything on tWriteJasonField, try to replace null with another date or handle the string further after tWriteJasonField, for example, replace all the string ",\"date\":[]"with empty string. 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 16 Jan 2013 05:48:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265417#M44969</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-16T05:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265418#M44970</link>
      <description>Good thinking Shong, I like the idea of just searching for the whole field and removing it altogether. 
&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 16 Jan 2013 14:51:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265418#M44970</guid>
      <dc:creator>jkrfs</dc:creator>
      <dc:date>2013-01-16T14:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265419#M44971</link>
      <description>I added a tJavaRow after tWriteJSONField and did this:&lt;BR /&gt;output_row.output = input_row.output.replaceAll(",\"*\":\\", "");&lt;BR /&gt;Works like a charm.</description>
      <pubDate>Wed, 16 Jan 2013 21:42:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265419#M44971</guid>
      <dc:creator>jkrfs</dc:creator>
      <dc:date>2013-01-16T21:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265420#M44972</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I added a tJavaRow after tWriteJSONField and did this:&lt;BR /&gt;output_row.output = input_row.output.replaceAll(",\"*\":\\", "");&lt;BR /&gt;Works like a charm.&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Cool, thanks for your feedback and the solution.
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 17 Jan 2013 06:17:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265420#M44972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-17T06:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265421#M44973</link>
      <description>BTW, for those, who faced similiar problem:&lt;BR /&gt;regex provided by jkrfs works for his case, but will not work if you have fields with underscore character&amp;nbsp;or digits in name. Use this instead:&lt;BR /&gt;replaceAll(",?\"*\":\\", "");</description>
      <pubDate>Tue, 29 Jul 2014 13:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265421#M44973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-29T13:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265422#M44974</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;BTW, for those, who faced similiar problem:&lt;BR /&gt;regex provided by jkrfs works for his case, but will not work if you have fields with underscore character&amp;nbsp;or digits in name. Use this instead:&lt;BR /&gt;replaceAll(",?\"*\":\\", "");&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt; 
&lt;FONT color="#434343"&gt;&lt;FONT size="1"&gt;&lt;FONT face="Tahoma, Arial"&gt;Hi Andrey&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT color="#434343"&gt;&lt;FONT size="1"&gt;&lt;FONT face="Tahoma, Arial"&gt;Thanks for offering a more comprehensive expression.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 30 Jul 2014 02:14:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265422#M44974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-30T02:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265423#M44975</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I have a flow going into tWriteJsonFIELD which creates an array&lt;BR /&gt;{docs:}&lt;BR /&gt;However, if lets say the date is missing in one of the fields, it looks like this:&lt;BR /&gt;{docs:}&lt;BR /&gt;]}&lt;BR /&gt;Which is not what I want. If the field is empty/null I do not want it to show up in the output at all, like so:&lt;BR /&gt;{docs:}&lt;BR /&gt;Does anyone have any advice or ideas on how I can achieve this?&lt;BR /&gt;Thank you!&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi,
&lt;BR /&gt;How did you achieve the below using the twriteJson, Please assist.&amp;nbsp;
&lt;BR /&gt;
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;{docs:}&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;BR /&gt;Thanks,</description>
      <pubDate>Thu, 03 Nov 2016 23:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265423#M44975</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2016-11-03T23:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265424#M44976</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi,&lt;BR /&gt;How did you achieve the below using the twriteJson, Please assist.&amp;nbsp;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;{docs:}&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hello Naina
&lt;BR /&gt;It seems your problem is not related to this subject. In order to better manage and follow up your questions, please report a topic for your question.&amp;nbsp;
&lt;BR /&gt;Regards
&lt;BR /&gt;Shong</description>
      <pubDate>Sun, 06 Nov 2016 09:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265424#M44976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-06T09:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Empty/Null fields show up in json output twritejsonfield</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265425#M44977</link>
      <description>I'm wondering how the behavior reported here isn't a bug. When the values are empty, how does it make sense to convert it to []? This is especially bad because, at the opposite end, tExtractJSONFields doesn't recognize those [], and either turns it into a literal string of "[]" or (for numbers) throws an exception. I added this hack, and it's working. Is there no option to avoid the hack?</description>
      <pubDate>Mon, 30 Jan 2017 22:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Empty-Null-fields-show-up-in-json-output/m-p/2265425#M44977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-30T22:04:27Z</dc:date>
    </item>
  </channel>
</rss>

