<?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>I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2 I</title><link>https://community.appian.com/discussions/f/rules/6596/i-have-question-related-to-cdt-array-i-have-two-cdt-arrays-cdt1-and-cdt2-i</link><description>I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2 I have to compare CDT1.id = CDT2.id if the ids match then CDT1.value is to be update by CDT2.value Please let me know if you have any solution. OriginalPostID-186559 OriginalPostID</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25949?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2015 16:11:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6e92f0d1-a1ca-4373-981a-92297b7750b7</guid><dc:creator>PhilB</dc:creator><description>Bit delayed, but I was thinking more like something below.&lt;br /&gt;&lt;br /&gt;A supporting rule, eg rule!myRule(), with two non-array inputs of CDT1 and CDT2 of the equivalent types:&lt;br /&gt;&lt;br /&gt;type!CDT2(&lt;br /&gt;  value: if(&lt;br /&gt;    isnull(&lt;br /&gt;      ri!CDT1.value&lt;br /&gt;     ),&lt;br /&gt;     ri!CDT2.value,&lt;br /&gt;     ri!CDT1.value&lt;br /&gt;   )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;...then a call of that rule within an apply, iterating over the arrays of the two types of CDT:&lt;br /&gt;&lt;br /&gt;apply(&lt;br /&gt;  rule!myRule,&lt;br /&gt;  merge(&lt;br /&gt;    local!arrayOfCDT1,&lt;br /&gt;    local!arrayOfCDT2&lt;br /&gt;  )&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;You could edit the supporting rule to map any number of fields, conditional or otherwise.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25936?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2015 01:13:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:adf58c79-bd7b-44b7-9dd6-507e6f28f650</guid><dc:creator>rishij</dc:creator><description>thank you very much @monikar&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25935?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2015 00:58:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:08779533-d7a3-40f8-871e-c1e3f93f06c5</guid><dc:creator>monikar</dc:creator><description>Hi rishij,&lt;br /&gt;&lt;br /&gt;This is my understanding of the requirement: Value of CDT1.value is to be replaced with CDT2.value when the CDT2.id matches CDT1.id&lt;br /&gt;For this I propose the following solution in two steps.&lt;br /&gt;&lt;br /&gt;1. To get the updated array of CDT1.value you can use the displayValue function &lt;br /&gt;&lt;br /&gt;Ref code: apply(fn!displyValue(value: _, inArray: CDT1.id, replacement: CDT2.value, default: default value), CDT2.id)&lt;br /&gt;&lt;br /&gt;2. In order to set it to CDT1.value you can use the shared component specified by tim.clarke.&lt;br /&gt;&lt;br /&gt;Ref code: &lt;br /&gt;updatecdt(CDT1, { value: {updated array} })&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25923?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 19:02:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d486dd76-a383-4805-984a-d8d9f1ba20e7</guid><dc:creator>rishij</dc:creator><description>hey philip, do u have some example or code snippet, that i could use for this.&lt;br /&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25922?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 15:49:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ddd79ff-b134-42f6-98b0-402ca85a6ace</guid><dc:creator>PhilB</dc:creator><description>If you want to do this out-of-the-box, then you could also use an apply of a rule that takes a single instance of each CDT and then uses a type constructor with conditionally set field values.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I have Question related to CDT Array. I have two CDT Arrays CDT1 and CDT2&lt;br /&gt;I</title><link>https://community.appian.com/thread/25913?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 09:20:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ca48228-41ba-4b9a-a537-9912e3ec16dc</guid><dc:creator>Tim</dc:creator><description>&lt;a href="https://forum.appian.com/suite/tempo/records/type/components/item/i8BCLGOdlMUpdGVqT-RV7oRg74uEGJO5yIdNklp-1ZtH3F1tosyebSo7rEoKHh1XQ/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The shared component above will help you with the updating of the value. Should have everything you need.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>