<?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>dynamic set values of CDT fields</title><link>https://community.appian.com/discussions/f/general/20358/dynamic-set-values-of-cdt-fields</link><description>Hello community, 
 Is it possible to add values from a list of string of string to fields where string 1 of the list maps to field 1 of the CDT, sting 2 to field 2 of the CDT etc. When I pass the list of strings to the CDT as a parameter in the expression</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: dynamic set values of CDT fields</title><link>https://community.appian.com/thread/79435?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 14:28:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:37fd57c2-763b-4606-8d06-efe47638c3df</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;In that case you may have to be a little less dynamic, casting to your CDT something like below.&amp;nbsp; You would want to wrap the casting in a rule, then call whenever necessary with the list input such as:&amp;nbsp; rule!createMyCdt(local!listOfValues).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!list: {&amp;quot;A&amp;quot;,&amp;quot;B&amp;quot;,&amp;quot;C&amp;quot;},

  &amp;#39;type!{urn:com:appian:types}Your_CDT&amp;#39;(
    Letter1: index(local!list,1,null),
    Letter2: index(local!list,2,null),
    Letter3: index(local!list,3,null),
    Letter4: index(local!list,4,null),
    Letter5: index(local!list,5,null)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic set values of CDT fields</title><link>https://community.appian.com/thread/79431?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 12:09:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0878124a-340d-4181-b174-1ca704f1709c</guid><dc:creator>erikb0001</dc:creator><description>&lt;p&gt;Thank you Chris,&lt;/p&gt;
&lt;p&gt;I am not sure if I am allowed to use plugins .&lt;br /&gt;I guess I have to think of a less dynamic solution.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dynamic set values of CDT fields</title><link>https://community.appian.com/thread/79387?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 14:40:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ab547ee5-337d-4449-97e3-2d49fb3d6e55</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;You will want to take a look at the &lt;a href="/b/appmarket/posts/cdt-manipulation"&gt;Dictionary Manipulation&lt;/a&gt; plugin - very handy for these types of use cases:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!cdt: {letter1: null, letter2: null, letter3: null, letter4: null, letter5: null},
  local!list: {&amp;quot;A&amp;quot;,&amp;quot;B&amp;quot;,&amp;quot;C&amp;quot;},
  
  fn!createdictionary(
    keys: index(fn!getkeysfromdictionary(local!cdt),1+enumerate(count(local!list)),{}),
    values: local!list
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>