<?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>is cast() case sensitive ?</title><link>https://community.appian.com/discussions/f/rules/15018/is-cast-case-sensitive</link><description>Hello, 
 
 When I&amp;#39;m trying to cast JSON to CDT it populates data from that response to cdt object only of field names are exactly same in both json and CDT. e.g. 
 if json response is: 
 { 
 &amp;quot;firstName&amp;quot; : &amp;quot;Abc&amp;quot;, 
 &amp;quot;LastName&amp;quot;: &amp;quot;Xyz&amp;quot; 
 } 
 and CDT is having</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: is cast() case sensitive ?</title><link>https://community.appian.com/thread/67198?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2019 08:21:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:edda018a-aca8-4b19-b7ed-4e90c4f760a5</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Cast() IS Case Sensitive:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!case: {
    title: &amp;quot;Mr.&amp;quot;,
    DESCRIPTION: &amp;quot;Example&amp;quot;
  },
  fn!cast(
    &amp;#39;type!{urn:com:appian:types:SJB}SJB_CASE&amp;#39;,
    local!case
  )
  
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The CDT used in the above example has all of its attributes (other than its Primary Key) in lower-case and the output is as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SJB_CASE
    CaseId: null (Number (Integer))
    title: &amp;quot;Mr.&amp;quot;
    description: null (Text)
    owner: null (Text)
    status: null (Text)
    startDate: null (Date)
    endDate: null (Date)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As you can see, &amp;#39;title&amp;#39; is copied across, but &amp;#39;DESCRIPTION&amp;#39; is not.&lt;/p&gt;
&lt;p&gt;I do not know if a way of accessing the individual attributes and applying any function to change the case of any attribute. As far as I know your only option is to hand-cast the data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!case: {
    title: &amp;quot;Mr.&amp;quot;,
    DESCRIPTION: &amp;quot;Example&amp;quot;
  },
  local!castCase: &amp;#39;type!{urn:com:appian:types:SJB}SJB_CASE&amp;#39;(
    title: local!case.title,
    description: local!case.DESCRIPTION
  ),
  local!castCase
  
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is cast() case sensitive ?</title><link>https://community.appian.com/thread/67194?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2019 06:31:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a15fd42-0e1d-4d19-b26e-f0da86f36e81</guid><dc:creator>bhanuprakash1303</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="/members/tushark171"&gt;tushark&lt;/a&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;cast() is not a case sensitive..&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;if you want convert json to respective cdt we can use below code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!jdata: {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;quot;firstName&amp;quot; : &amp;quot;Abc&amp;quot;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;quot;LastName&amp;quot;: &amp;quot;Xyz&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; },&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;cast(typeof(&lt;br /&gt;&amp;#39;type!{urn:com:appian:types}employeedetails&amp;#39;()&lt;br /&gt;),local!jdata))&lt;/p&gt;
&lt;p&gt;it will work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bhanu,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>