<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>a!toJson excluding null values.</title><link>https://community.appian.com/discussions/f/rules/28221/a-tojson-excluding-null-values</link><description>I have CDT with following fields 
 
 
 While using a!toJson , it is EXCLUDING fields which are having NULL values except fields with TEXT datatype. 
 
 Expresion: - a!localVariables( local!data: &amp;#39;type!{urn:com:appian:types:RS}RS_dummyCDT&amp;#39;(id: 1, name</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110270?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 12:46:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1b944f86-a5df-4501-afb9-4e83f49003af</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In the documentation for a!toJson() it makes no mention of empty fields of other types being removed, particularly when &amp;quot;FALSE&amp;quot; is passed in for the &amp;quot;removeNullOrEmptyFields&amp;quot; parameter (even though that&amp;#39;s also supposed to be the default behavior).&lt;/p&gt;
&lt;p&gt;I&amp;#39;d suggest raising a support case with Appian to address this potential discrepancy.&amp;nbsp; I&amp;#39;d expect (if you&amp;#39;re very lucky anyway) they might slot this in for an enhanced &amp;quot;evolved version&amp;quot; where the new one contains the behavior you&amp;#39;re after - since just changing this behavior in the existing version could potentially break current uses of the current version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110261?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 11:16:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2b9c0e1-6ce3-433e-a314-7375c9c06e12</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Interesting. I did a quick test, and casting the CDT to a Map before the transformation seems to include empty fields. Maybe you wanna test this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!toJson(
  cast(
    type!Map,
    &amp;#39;type!{urn:com:appian:types:AA}AA_Vehicle&amp;#39;(
      vehicleId: 1
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110256?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 10:17:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:89874d44-b1e4-411d-80e8-adaefacbaa78</guid><dc:creator>riyazn399986</dc:creator><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;Yes, we do have specific requirement to pass attributes even though value of the attribute is null.&lt;/p&gt;
&lt;p&gt;Is there any solution or work around for this issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110242?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 08:13:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:57f8a0a8-39a5-417d-9261-683f90b88de4</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Handling of non-populated field in JSON is a very&amp;nbsp;controversial topic. There is no real right or wrong.&lt;/p&gt;
&lt;p&gt;Do you have any specific requirement from the API you are talking to?&lt;/p&gt;
&lt;p&gt;I recommend to not use old versions of functions for new developments.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110240?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 07:49:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:70477649-3d5e-4cd8-8c23-29731298dd2a</guid><dc:creator>riyazn399986</dc:creator><description>&lt;p&gt;I am concerned if&amp;nbsp;&lt;strong&gt;&lt;span&gt;a!toJson_17r1 &lt;/span&gt;&lt;/strong&gt;get deprecated in future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a!toJson excluding null values.</title><link>https://community.appian.com/thread/110213?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 05:06:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d0dd4c6-51db-4100-a087-044113488893</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;I think they just improved the definition of the function to remove the null values. How about keep using the&amp;nbsp;&lt;strong&gt;&lt;span&gt;a!toJson_17r1&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;function?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>