<?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>comparing values of CDT in array</title><link>https://community.appian.com/discussions/f/data/12294/comparing-values-of-cdt-in-array</link><description>Hello, 
 
 I have a local variable storing list of CDT as array. 
 local!b:{ &amp;#39;type!{urn:com:appian:types:folders}CMN_RootCaseFolder&amp;#39;( objectId: &amp;quot;1&amp;quot;, objectName: &amp;quot;A&amp;quot;, parentId: &amp;quot;1&amp;quot;), &amp;#39;type!{urn:com:appian:types:folders}CMN_RootCaseFolder&amp;#39;( objectId: &amp;quot;2</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: comparing values of CDT in array</title><link>https://community.appian.com/thread/54479?ContentTypeID=1</link><pubDate>Thu, 26 Apr 2018 11:05:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d86640e-8e60-450f-afc7-9338b039a780</guid><dc:creator>jaidw</dc:creator><description>&lt;a href="/members/divyaa"&gt;divyaa&lt;/a&gt; From the above comment, what I understood is, you are looking to make it dynamic(instead of hard code). Simply use a apply() loop for each desired parentId.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comparing values of CDT in array</title><link>https://community.appian.com/thread/54458?ContentTypeID=1</link><pubDate>Wed, 25 Apr 2018 14:43:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4e5729d2-3bf8-45c6-9831-2483612d4633</guid><dc:creator>divyaa</dc:creator><description>Thank you &lt;a href="/members/jaidw"&gt;jaidw&lt;/a&gt; . I was able to move ahead with your solution.  But still curious to know how is this kind of looping carried out. In the above example, the whereContains() has 1 as value to be found, but if I have to check through all the CDT list with the value to found is the objectId value present in CDT in whereContains().&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comparing values of CDT in array</title><link>https://community.appian.com/thread/54390?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 06:53:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9f6d1488-fe2c-473d-bbf9-cb95cbb33f7a</guid><dc:creator>jaidw</dc:creator><description>&lt;p&gt;Hello Divyaa,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To achieve your requirement (For Example: the objectId=&amp;quot;1&amp;quot; is present as parentId in array elements) refer below code,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt;local!arrRootCaseFolder:{&lt;br /&gt; type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 1,&lt;br /&gt; objectName: &amp;quot;A&amp;quot;,&lt;br /&gt; parentId: 1&lt;br /&gt;),&lt;br /&gt;type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 2,&lt;br /&gt; objectName: &amp;quot;B&amp;quot;,&lt;br /&gt; parentId: 2&lt;br /&gt;),&lt;br /&gt;type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 3,&lt;br /&gt; objectName: &amp;quot;C&amp;quot;,&lt;br /&gt; parentId: 2&lt;br /&gt;),&lt;br /&gt;type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 4,&lt;br /&gt; objectName: &amp;quot;D&amp;quot;,&lt;br /&gt; parentId: 1&lt;br /&gt;),&lt;br /&gt;type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 5,&lt;br /&gt; objectName: &amp;quot;E&amp;quot;,&lt;br /&gt; parentId: 1&lt;br /&gt;),&lt;br /&gt;type!CMN_RootCaseFolder(&lt;br /&gt; objectId: 6,&lt;br /&gt; objectName: &amp;quot;F&amp;quot;,&lt;br /&gt; parentId: 2&lt;br /&gt;)&lt;br /&gt;},&lt;br /&gt;local!result: index(local!arrRootCaseFolder,whereContains(1,index(local!arrRootCaseFolder,&amp;quot;parentId&amp;quot;,0)),&amp;quot;&amp;quot;),&lt;br /&gt;local!result&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="GJEWJWHDGOB"&gt;
&lt;div class="GJEWJWHDNNB appian-live-view"&gt;
&lt;div class="GJEWJWHDOOB GJEWJWHDLPB"&gt;
&lt;div&gt;
&lt;div class="GJEWJWHDPIC"&gt;
&lt;div class="column_panel"&gt;
&lt;div&gt;
&lt;div class="GJEWJWHDPIC"&gt;
&lt;div class="GJEWJWHDEV aui-Section GJEWJWHDDV"&gt;
&lt;div class="GJEWJWHDFV GJEWJWHDBV"&gt;
&lt;div&gt;
&lt;div class="GJEWJWHDPIC"&gt;
&lt;div class="column_panel"&gt;
&lt;div&gt;
&lt;div class="GJEWJWHDPIC"&gt;
&lt;div&gt;
&lt;div class="aui_FieldLayout"&gt;
&lt;div class="aui_FieldLayout GJEWJWHDE2 aui-LabelPositionAdjacent"&gt;&lt;strong&gt;&lt;span class="aui_FieldLayout_Label GJEWJWHDGT GJEWJWHDFT"&gt;&lt;span id="gwt-uid-9836" class="noninput_label labelPosition-ADJACENT"&gt;Type&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;
&lt;div class="GJEWJWHDJ2"&gt;
&lt;div class="aui_FieldLayout_InputContainer"&gt;
&lt;p class="appian_form_readonly GJEWJWHDE0 GJEWJWHDDMB aui-Field-readonly"&gt;CMN_RootCaseFolder?list&lt;/p&gt;
&lt;/div&gt;
&lt;div class="aui_FieldLayout_MessageContainer"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="aui_FieldLayout_MessageContainer"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="aui_FieldLayout"&gt;
&lt;div class="aui_FieldLayout GJEWJWHDE2 aui-LabelPositionAdjacent"&gt;&lt;strong&gt;&lt;span class="aui_FieldLayout_Label GJEWJWHDGT GJEWJWHDFT"&gt;&lt;span id="gwt-uid-14194" class="noninput_label labelPosition-ADJACENT"&gt;Value&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;
&lt;div class="GJEWJWHDJ2"&gt;
&lt;div class="aui_FieldLayout_InputContainer"&gt;
&lt;p class="appian_form_readonly GJEWJWHDE0 GJEWJWHDDMB aui-Field-readonly"&gt;[objectId=1, objectName=A, parentId=1]; [objectId=4, objectName=D, parentId=1]; [objectId=5, objectName=E, parentId=1]&lt;/p&gt;
&lt;/div&gt;
&lt;div class="aui_FieldLayout_MessageContainer"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="aui_FieldLayout_MessageContainer"&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="GJEWJWHDHOB"&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comparing values of CDT in array</title><link>https://community.appian.com/thread/54384?ContentTypeID=1</link><pubDate>Mon, 23 Apr 2018 22:42:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a5e4a74e-4c91-416f-a9db-d9757e720090</guid><dc:creator>aloks0189</dc:creator><description>Hi &lt;a href="/members/divyaa"&gt;divyaa&lt;/a&gt;  for this you need to do looping over this cdt array using a!foreach()&lt;br /&gt;
&lt;br /&gt;
Where during each iteration you need to use wherecontains() to check whether this current cdt object id is present as parentid to some other cdt or not, if yes, store it&amp;#39;s index in a local variable using append.&lt;br /&gt;
&lt;br /&gt;
This should work.&lt;br /&gt;
&lt;br /&gt;
But out of interest, let&amp;#39;s assume you have got the CDT indexes where id is being referred as parentid, then what? What exactly you are trying to achieve, I mean, you just want to know the CDT indexes or you want to do some manipulation on this?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>