<?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>How to get CDT elements as value</title><link>https://community.appian.com/discussions/f/rules/13362/how-to-get-cdt-elements-as-value</link><description>Hi All, 
 I have a requirement where a DB table columns i.e. my CDT elements should be in dropdown values (as choice labels /values). 
 For example: I have a DB table Employee and underlying CDT employee_CDT. I need all columns name as output (a string</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60448?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 06:45:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0cc7618-5889-44a9-8357-f2f9dfefe47b</guid><dc:creator>Siva</dc:creator><description>Hi Nidhi,&lt;br /&gt;
&lt;br /&gt;
As mentioned by Amit,&lt;br /&gt;
&lt;br /&gt;
Create an expression rule and pass inputDataType(any type) as &amp;#39;type!{urn:com:appian:types}employee_CDT&amp;#39;()&lt;br /&gt;
&lt;br /&gt;
if(&lt;br /&gt;
  rule!APN_isEmpty(&lt;br /&gt;
    ri!inputDataType&lt;br /&gt;
  ),&lt;br /&gt;
  &amp;quot;&amp;quot;,&lt;br /&gt;
  stripwith(&lt;br /&gt;
    split(&lt;br /&gt;
      ri!inputDataType,&lt;br /&gt;
      &amp;quot;=,&amp;quot;&lt;br /&gt;
    ),&lt;br /&gt;
    &amp;quot;[=]&amp;quot;&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Siva&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60447?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 05:37:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2a48cc8-16ba-421a-8dc0-a06c81fa80ba</guid><dc:creator>nidhim855</dc:creator><description>Thank You Ketan.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60446?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 05:36:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f3d9998a-04ad-4c1a-8556-1c240f05269d</guid><dc:creator>nidhim855</dc:creator><description>Thank You . Its really helped me.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60420?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 15:35:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:49c63f3e-f4b7-4b3f-96c3-1ef72dcaeb5a</guid><dc:creator>Ketan Patel</dc:creator><description>If it is an Oracle DB - you can directly use query DB smart service to get column names and use it as label:&lt;br /&gt;
&lt;br /&gt;
select COLUMN_NAME from ALL_TAB_COLUMNS where TABLE_NAME=&amp;#39;MyTableName&amp;#39;;&lt;br /&gt;
&lt;br /&gt;
I would say it is not the best way but straight forward rather.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60415?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 12:49:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ae59615-cb47-44e2-887a-b6b051931572</guid><dc:creator>amitm9</dc:creator><description>&amp;#39;type!{urn:com:appian:types}employee_CDT&amp;#39;()  &lt;br /&gt;
--- instead of employee_CDT you can use any CDT name for which you would like to get elements. Remember &amp;quot;namespace&amp;quot; of your CDT should be the same, if different then change accordingly. Thanks&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get CDT elements as value</title><link>https://community.appian.com/thread/60414?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 12:44:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0ae7847b-8261-4638-b1e6-045da9dcc701</guid><dc:creator>amitm9</dc:creator><description>Hi Nidhi,&lt;br /&gt;
&lt;br /&gt;
Try using below logic.&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!CDTFields: split(stripwith(tostring(&amp;#39;type!{urn:com:appian:types}employee_CDT&amp;#39;()),&amp;quot;[=] &amp;quot;), &amp;quot;,&amp;quot;),&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   { local!CDTFields}&lt;br /&gt;
        &lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
this will give you all elements of your CDT &amp;quot;employee_CDT&amp;quot;. If you want to remove/hide any column, lets say default &amp;quot;id&amp;quot; column. then use difference function. As below code.&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!CDTFields: split(stripwith(tostring(&amp;#39;type!{urn:com:appian:types}employee_CDT&amp;#39;()),&amp;quot;[=] &amp;quot;), &amp;quot;,&amp;quot;),&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
   { difference(local!CDTFields,&amp;quot;id&amp;quot;) }&lt;br /&gt;
        &lt;br /&gt;
    )&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>