<?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>Converting an API response JSON to the an existing CDT</title><link>https://community.appian.com/discussions/f/data/17937/converting-an-api-response-json-to-the-an-existing-cdt</link><description>Hi, One of my APIs returns a JSON file and this needs to be passed to a CDT. The API returns the JSON KVP in Camel format but the CDT which existed and in extensive use has its fields setup with &amp;#39;underscores&amp;#39;. Is there a way that once my Appian application</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Converting an API response JSON to the an existing CDT</title><link>https://community.appian.com/thread/70625?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 11:59:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:48738e36-412f-4c5a-9e8b-136c3522f88d</guid><dc:creator>Krishna Chaitanya Mallavarapu</dc:creator><description>&lt;p&gt;If the response is single then use below code&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!jsonResponse: {&lt;br /&gt; &amp;quot;companyId1&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt; &amp;quot;companyId2&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt; &amp;quot;companyId3&amp;quot;: &amp;quot;3&amp;quot;,&lt;br /&gt; &amp;quot;companyId4&amp;quot;: &amp;quot;4&amp;quot;,&lt;br /&gt; &lt;br /&gt; },&lt;br /&gt; type!CDT(&lt;br /&gt; company_id_1: local!jsonResponse.companyId1,&lt;br /&gt; company_id_2: local!jsonResponse.companyId2,&lt;br /&gt; company_id_3: local!jsonResponse.companyId3,&lt;br /&gt; company_id_4: local!jsonResponse.companyId4&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If the response is multiple&amp;nbsp;&amp;nbsp;then use below code&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;load(&lt;br /&gt; local!jsonResponse: {&lt;br /&gt; &amp;quot;companyId1&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt; &amp;quot;companyId2&amp;quot;: &amp;quot;2&amp;quot;,&lt;br /&gt; &amp;quot;companyId3&amp;quot;: &amp;quot;3&amp;quot;,&lt;br /&gt; &amp;quot;companyId4&amp;quot;: &amp;quot;4&amp;quot;,&lt;br /&gt; &lt;br /&gt; },&lt;br /&gt; a!forEach(&lt;br /&gt; items: local!jsonResponse,&lt;br /&gt; expression: type!CDT(&lt;br /&gt; company_id_1: fv!item.companyId1,&lt;br /&gt; company_id_2: fv!item.companyId2,&lt;br /&gt; company_id_3: fv!item.companyId3,&lt;br /&gt; company_id_4: fv!item.companyId4&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>