<?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>Index Function</title><link>https://community.appian.com/discussions/f/new-to-appian/28243/index-function</link><description>Hi Experts, 
 How to use Index Function to extract whole row data from a list of records based on one record field value? 
 
 We want to extract one row data from local! data where one fieldname : id has a value: 100051</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Index Function</title><link>https://community.appian.com/thread/110312?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 20:04:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ed588d1-af03-492e-a9be-cc953982662e</guid><dc:creator>sanchitg0002</dc:creator><description>[quote userid="59361" url="~/discussions/f/new-to-appian/28243/index-function/110307#110307"]To get a single item[/quote]
&lt;p&gt;This is the issue with displayvalue that it only searches for the first occurrence of the given value in the list and returns corresponding replacement value, dk when they will enhance it to return multiple values.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s why we always use a generic rule to perform such operation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;index(
    local!data,
    wherecontains(42, local!data.id),
    null
  )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Although in this case it will work nevertheless, assuming that the searched value is always unique here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index Function</title><link>https://community.appian.com/thread/110310?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 19:18:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24481b60-4dc5-484c-a6bf-d5e660d07a35</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;Good to know.&amp;nbsp; I always used index( array of CDT, wherecontains( ID I want to find, arrayofCDT . idField))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index Function</title><link>https://community.appian.com/thread/110307?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 19:00:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f66c424b-1733-43c4-a35d-237d99d5b3d4</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;To get a single item you can just use the displayvalue function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    a!map(id: 7, name: &amp;quot;Max&amp;quot;),
    a!map(id: 42, name: &amp;quot;Otto&amp;quot;),
    a!map(id: 100, name: &amp;quot;Joe&amp;quot;),
  },
  displayvalue(
    42,
    local!data.id,
    local!data,
    null
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>