<?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>Extract date using index</title><link>https://community.appian.com/discussions/f/general/11912/extract-date-using-index</link><description>I am trying to extract out an array from allResults which contains a certain ID . since ID is an integer , i used index and where contains 
 
 index( local!allResults, wherecontains( ri!Id, tointeger(touniformstring( local!allResults.Id)) ) ) 
 
 
 What</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Extract date using index</title><link>https://community.appian.com/thread/52730?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 16:40:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:667a8a80-7862-4e16-b23b-0dd09bfccbbf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Per daniell&amp;#39;s suggestion, but perhaps even easier, I would use a!forEach like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
  local!allResults,
  if(
    fv!item.date &amp;gt; today(),
    fv!item,
    {}
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would allow you to return an array of the matching results directly, without having to go through the runaround of calculating a list of indexes to then use for the index() function on the array.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extract date using index</title><link>https://community.appian.com/thread/52725?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 14:43:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fec97f12-9e2a-40d5-8bfa-529d72b533af</guid><dc:creator>Rama Thummala</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
Please use index(masterArray, where(apply(rule!isDateGreater(data:_)),{masterArray}),{}).&lt;br /&gt;
&lt;br /&gt;
rule!isDateGreater&lt;br /&gt;
-----------------------------&lt;br /&gt;
add your date condition, result should be boolean.&lt;br /&gt;
&lt;br /&gt;
Hope it will help you..!!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extract date using index</title><link>https://community.appian.com/thread/52697?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 22:33:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5aef7374-f5c1-4666-945b-4f064a4580b5</guid><dc:creator>Dan Lluhi</dc:creator><description>Hi, instead of using wherecontains it sounds like you want to build something to the effect of &amp;quot;whereGreaterThan&amp;quot;. You could do so inline by using a!forEach. Iterate over the list local!allResults.date, and for each item compare the value to ri!date. If the value is greater, return the index, otherwise, return {}. That way, you&amp;#39;ll be passing an array of the indices you&amp;#39;re after to fn!index, and it will return the subset array that you&amp;#39;re looking for, because index&amp;#39;s second (named index) parameter accepts arrays (index (Number (Integer)): The index or array of indices of the array.). &lt;br /&gt;
&lt;br /&gt;
If you&amp;#39;re on an earlier version of Appian and a!forEach isn&amp;#39;t available, you can accomplish the same thing by creating a new rule and using apply().&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Dan&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>