<?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>how to extract the data from key-value array?</title><link>https://community.appian.com/discussions/f/user-interface/14718/how-to-extract-the-data-from-key-value-array</link><description>Hi, 
 we have data from query entity rule like 
 {{cText:&amp;quot;one&amp;quot;,typeId:1},{ cText :&amp;quot;two&amp;quot;, typeId :2},{ cText :&amp;quot;three&amp;quot;, typeId :3}} from this ,we need to extract the required cText by passing the typeId . 
 Is there any direct way by using the array function</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90588?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 09:01:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52e6dcdc-cd08-4dbf-9b0f-0ed16f955f7c</guid><dc:creator>siddharthb0005</dc:creator><description>&lt;p&gt;yeah, a!localvariables is working better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90587?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:46:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f96a184-345b-4321-ad6b-292dfea1d422</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;it is&amp;nbsp;the same situation like&lt;br /&gt;apply() &amp;amp; a!applycomponenst()&amp;nbsp; and the newer a!forEach():&lt;br /&gt;isnull and a!isNullOrEmpty() and so on&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90586?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:40:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e2c484f9-f835-4d6f-b6a5-9bdd97d5ef72</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;load is old .&lt;br /&gt;&lt;img height="55" src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1643877631023v1.png" width="463" alt=" " /&gt;&lt;br /&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/fnc_evaluation_load.html"&gt;https://docs.appian.com/suite/help/21.4/fnc_evaluation_load.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There is a reason for this box.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90585?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:37:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb3d2904-48b9-4103-a50a-17d54503f153</guid><dc:creator>siddharthb0005</dc:creator><description>&lt;p&gt;no it&amp;#39;s not, you can check it in documentation and it&amp;#39;s quite helpful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90584?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:36:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19cdafb3-e05b-40ad-9807-30b809cf43f1</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;why load()? That&amp;#39;s an antique&amp;nbsp;function....&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/90581?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 07:32:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1344c00f-7a01-436b-89bc-8959bb748dd1</guid><dc:creator>siddharthb0005</dc:creator><description>&lt;p&gt;load(&lt;br /&gt; local!myMap: { a!map(rollNumber:1,firstName:&amp;quot;something1&amp;quot;),a!map(rollNumber:2,firstName:&amp;quot;something2&amp;quot;)},&lt;br /&gt; &lt;br /&gt; displayvalue(ri!rollNumber, local!myMap.rollNumber, local!myMap.firstName, null)&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/65966?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2019 12:05:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b08f2d9b-09d5-4037-8cf8-49584522c97a</guid><dc:creator>ramp</dc:creator><description>&lt;p&gt;Thanks for the reply. sure will take are of the repeated values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/65965?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2019 12:04:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6855c63c-ab53-4425-bc4c-21a4d18c1964</guid><dc:creator>ramp</dc:creator><description>&lt;p&gt;Thanks... it solved our issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/65964?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2019 11:18:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d307fab-3cea-49c7-a9f8-7aef79e48817</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;As per Stefan&amp;#39;s response, displayValue will work but only if your use case is to find a unique value of typeId. If the values of typeId can appear more than once then displayValue will only return the first occurrence. If you want to return ALL occurrences of cText for a given typeId then you&amp;#39;ll need to take a different approach:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!myData: {{cText:&amp;quot;one&amp;quot;,typeId:1},{cText:&amp;quot;two&amp;quot;,typeId:1},{cText:&amp;quot;three&amp;quot;,typeId:3}},
  fn!index(
    fn!index(local!myData,&amp;quot;cText&amp;quot;,null),
    wherecontains(ri!typeId, fn!tointeger(fn!index(local!mydata,&amp;quot;typeId&amp;quot;,null))
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract the data from key-value array?</title><link>https://community.appian.com/thread/65938?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 18:19:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de04f6b3-8a29-41e8-a8cb-a6a17728517c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You can use the function displayvalue for it. Goes something like displayvalue(ri!typeId, local!array.typeId, local!array.cText, null)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>