<?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 from a local variable querying data from the data table</title><link>https://community.appian.com/discussions/f/rules/26618/index-from-a-local-variable-querying-data-from-the-data-table</link><description>Hello everyone, 
 
 I have a local variable that query data from data table.The data looks like below: 
 local!cases: { 
 (clientId: 234,group: 55), 
 (clientId: 600, group: 66), 
 (clientId:234, group: 77), 
 (clientId: 600, group: 88), 
 (clientId:</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Index from a local variable querying data from the data table</title><link>https://community.appian.com/thread/104512?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 09:22:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d612e08-ed12-4b00-b928-a729b67e7548</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This works perfectly fine for me.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!cases: {

    {clientId: 234,group: 55},

    {clientId: 600, group: 66},

    {clientId: 234, group: 77},

    {clientId: 600, group: 88},

    {clientId: 234, group: 99}

  },
  index(local!cases.group,wherecontains(600,tointeger(local!cases.clientId)),null),
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from a local variable querying data from the data table</title><link>https://community.appian.com/thread/104511?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 09:20:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a4e99b6-200f-4f9f-9ce1-7f3342051217</guid><dc:creator>mollyn126</dc:creator><description>&lt;p&gt;Sorry I was trying to create a similar data as mine was a list queried from DB. &lt;/p&gt;
&lt;p&gt;The right format should be as you said:&lt;/p&gt;
&lt;p&gt;local!cases: &amp;#123;&lt;/p&gt;
&lt;p&gt;&amp;#123;clientId: 234,group: 55&amp;#125;,&lt;/p&gt;
&lt;p&gt;&amp;#123;clientId: 600, group: 66&amp;#125;,&lt;/p&gt;
&lt;p&gt;&amp;#123;clientId:234, group: 77&amp;#125;,&lt;/p&gt;
&lt;p&gt;&amp;#123;clientId: 600, group: 88&amp;#125;,&lt;/p&gt;
&lt;p&gt;&amp;#123;clientId: 234, group: 99&amp;#125;&lt;/p&gt;
&lt;p&gt;&amp;#125;&lt;/p&gt;
&lt;p&gt;I’ve checked and group is actually a list of number(integer), not text as stated&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index from a local variable querying data from the data table</title><link>https://community.appian.com/thread/104498?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 07:06:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b083c96c-a429-4380-b4d3-22b3e67d16a6</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Are you sure that your data really looks like this?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This: (clientId: 234,group: 55),&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;is not an Appian dictionary. It should use curly brackets:&lt;/span&gt;&amp;nbsp; {&lt;span&gt;clientId: 234,group: 55},&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you share a better working code example?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>