<?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 can I show the data of two local variables into one grid</title><link>https://community.appian.com/discussions/f/administration/18216/how-can-i-show-the-data-of-two-local-variables-into-one-grid</link><description>I am using two local variables and the data is coming via expression rules (there are multiple columns) 
 local!empStatus: index(rule!EO_getEmpStatus(),&amp;quot;data&amp;quot;,{}), local!empDetail: index(rule!EO_getEmpDetail(),&amp;quot;data&amp;quot;,{}) 
 I want to use the data of local</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71843?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 17:54:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46c2c374-f172-40c9-8817-3f6954b74ea0</guid><dc:creator>ankitas0001</dc:creator><description>&lt;p&gt;Thankyou &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have created a view for this and now its working, I guess this would be a best solution for this scenario, correct me If I am wrong.&lt;/p&gt;
&lt;p&gt;Thankyou &lt;a href="/members/ankitab0001"&gt;ankitab0001&lt;/a&gt; ,  and&amp;nbsp;  for your time on this post. I really appreciate your efforts and I have learn that how we can handle this scenario in Appian.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ankita Singh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71809?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 13:09:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a1e7c30-2dd0-432f-85df-518c7585a7f3</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;In general my best suggestion would be to create a database View which could merge the two source tables (i assume these are drawing their data from DB tables, anyway), as already mentioned by Nandhavi in another comment below - this will allow you to create a grid based on a single query of data where it&amp;#39;s already a consolidated data set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71808?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 13:07:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aed93970-b53a-4748-95df-b69e8971393a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;FYI, if &lt;a href="/members/ankitas0001"&gt;ankitas0001&lt;/a&gt; is on 19.2+, your code will produce an error as you&amp;#39;re using the old (deprecated) paging grid component format, but not referring to it as its new name &lt;em&gt;a!gridField_19r2&lt;/em&gt;.&amp;nbsp; I would suggest updating the code to reflect 19.2+, though, as it&amp;#39;s a lot friendlier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71799?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 06:03:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d1c25803-642f-4fe2-86b9-70ec6eed20ed</guid><dc:creator>srinandhavin5120</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/ankitas0001"&gt;ankitas0001&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Alternatively, you can also create a VIEW and join the 2 tables from which you are querying the data for empStatus and empDetail.&lt;/p&gt;
&lt;p&gt;This will be an efficient way because you can query all the required data in a single shot and also in the desired format.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71798?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 03:28:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf4ae310-8a11-40b5-a8e2-2bdb5a800172</guid><dc:creator>ankitab0001</dc:creator><description>&lt;p&gt;Where exactly are you getting the error? The above code is also a read only field&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71792?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 20:27:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0b7a7cdf-6463-49f6-9e66-261cf75c67e9</guid><dc:creator>ankita0004</dc:creator><description>&lt;p&gt;2nd one&amp;nbsp;&lt;/p&gt;
&lt;p&gt;load(&lt;/p&gt;
&lt;p&gt;local!empStatus: {{id:3,empId:1,status:&amp;quot;Active&amp;quot;}, {id:2, empId:2, status:&amp;quot;Active&amp;quot;}, {id:1, empId:3, status: &amp;quot;Inactive&amp;quot;}},&lt;br /&gt; local!empDetail: {{id:1,name:&amp;quot;ABC&amp;quot;}, {id:2, name:&amp;quot;PQR&amp;quot;}, {id:3, name: &amp;quot;LMN&amp;quot;}},&lt;/p&gt;
&lt;p&gt;a!formLayout(&lt;br /&gt; label:&amp;quot;Form&amp;quot;,&lt;br /&gt; contents:{&lt;br /&gt; a!gridField(&lt;br /&gt; label:&amp;quot;grid&amp;quot;,&lt;br /&gt; data:local!empDetail,&lt;br /&gt; pageSize:5,&lt;br /&gt; pagingSaveInto:fv!pagingInfo,&lt;br /&gt; columns:{&lt;br /&gt; a!gridColumn(&lt;br /&gt; label:&amp;quot;Name&amp;quot;,&lt;br /&gt; value:fv!row.name&lt;br /&gt; ),&lt;br /&gt; a!gridColumn(&lt;br /&gt; label:&amp;quot;Status&amp;quot;,&lt;br /&gt; value:index(&lt;br /&gt; index(&lt;br /&gt; local!empStatus,&lt;br /&gt; wherecontains(&lt;br /&gt; tointeger(fv!row.id),&lt;br /&gt; tointeger(index(local!empStatus,&amp;quot;empId&amp;quot;,{}))&lt;br /&gt; ),&lt;br /&gt; {}&lt;br /&gt; ),&lt;br /&gt; &amp;quot;status&amp;quot;,&lt;br /&gt; {}&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71791?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 20:26:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:42f2f0ef-c757-4ee3-8331-c997381773df</guid><dc:creator>ankita0004</dc:creator><description>&lt;p&gt;Hi Ankita,&lt;/p&gt;
&lt;p&gt;You can try any of the code between these 2.&lt;/p&gt;
&lt;p&gt;load(&lt;/p&gt;
&lt;p&gt;local!empStatus: {{id:3,empId:1,status:&amp;quot;Active&amp;quot;}, {id:2, empId:2, status:&amp;quot;Active&amp;quot;}, {id:1, empId:3, status: &amp;quot;Inactive&amp;quot;}},&lt;br /&gt; local!empDetail: {{id:1,name:&amp;quot;ABC&amp;quot;}, {id:2, name:&amp;quot;PQR&amp;quot;}, {id:3, name: &amp;quot;LMN&amp;quot;}},&lt;br /&gt;local!empFinaldata:a!foreach(&lt;br /&gt; items:local!empDetail,&lt;br /&gt; expression:{&lt;br /&gt; id:fv!item.id,&lt;br /&gt; name:fv!item.name,&lt;br /&gt; status:index(&lt;br /&gt; index(&lt;br /&gt; local!empStatus,&lt;br /&gt; wherecontains(&lt;br /&gt; tointeger(fv!item.id),&lt;br /&gt; tointeger(index(local!empStatus,&amp;quot;empId&amp;quot;,{}))&lt;br /&gt; ),&lt;br /&gt; {}&lt;br /&gt; ),&lt;br /&gt; &amp;quot;status&amp;quot;,&lt;br /&gt; {}&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt;),&lt;br /&gt; a!formLayout(&lt;br /&gt; label:&amp;quot;Form&amp;quot;,&lt;br /&gt; contents:{&lt;br /&gt; a!gridField(&lt;br /&gt; label:&amp;quot;grid&amp;quot;,&lt;br /&gt; data:local!empFinaldata,&lt;br /&gt; pageSize:5,&lt;br /&gt; pagingSaveInto:fv!pagingInfo,&lt;br /&gt; columns:{&lt;br /&gt; a!gridColumn(&lt;br /&gt; label:&amp;quot;Name&amp;quot;,&lt;br /&gt; value:fv!row.name&lt;br /&gt; ),&lt;br /&gt; a!gridColumn(&lt;br /&gt; label:&amp;quot;Status&amp;quot;,&lt;br /&gt; value:fv!row.status&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71790?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 18:43:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98a4d306-42be-470c-a81d-b03b6601d35d</guid><dc:creator>ankitas0001</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/ankitab0001"&gt;ankitab0001&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Thankyou for the time.&lt;/p&gt;
&lt;p&gt;I have tried your scenario as well but i am getting an error as I want to use&amp;nbsp;&lt;span&gt;a!gridColumn (its a read only grid).&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:12px;"&gt;Regards&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ankita Singh&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71788?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 18:14:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9bac8b7a-b075-44ae-9905-b02ebf0d6726</guid><dc:creator>ankitas0001</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thankyou for your time.&lt;/p&gt;
&lt;p&gt;rule!EO_getEmpStatus() is returning empId and status&lt;/p&gt;
&lt;p&gt;rule!EO_getEmpDetail()&amp;nbsp; is returning empId, firstName, lastName, band, group etc. fields.&lt;/p&gt;
&lt;p&gt;I want to show the data of following columns in my grid on the basis of empId: &lt;strong&gt;empId, firstName, lastName, status, band, group&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ankita Singh&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71646?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 22:28:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2d3f31c-32d2-4d75-a594-c742ec7fd491</guid><dc:creator>ankitab0001</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/ankitas0001"&gt;ankitas0001&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can try something similar to this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  
  local!empStatus: {{id:3,status:&amp;quot;Active&amp;quot;}, {id:2, status:&amp;quot;Active&amp;quot;}, {id:1, status: &amp;quot;Inactive&amp;quot;}},
  local!empDetail: {{id:1,name:&amp;quot;ABC&amp;quot;}, {id:2, name:&amp;quot;PQR&amp;quot;}, {id:3, name: &amp;quot;LMN&amp;quot;}},

a!formLayout(
  label:&amp;quot;Form&amp;quot;,
  contents:{
    a!gridField(
      label:&amp;quot;Employee&amp;quot;,
      totalCount: 3,
      columns: {
        a!gridTextColumn(
          label:&amp;quot;Name&amp;quot;,
          data:local!empDetail.name
        ),
        a!gridTextColumn(
          label:&amp;quot;Status&amp;quot;,
          data:a!forEach(local!empDetail,index(local!empStatus.status, wherecontains(fv!item.id,local!empStatus.id)))
        )
      },
      value: a!pagingInfo(startIndex: 1, batchSize: -1),
      saveInto: {},
      identifiers:local!empDetail.id
    )
  }
)
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But, as suggested by Mike, you can append the cdts in a local variable and then use that data subset. This will avoid the overuse of the looping function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I show the data of two local variables into one grid</title><link>https://community.appian.com/thread/71644?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 18:08:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:be451478-749e-4f98-af00-d4ecd3592235</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;It completely depends on whether the two queries return similar data types, but for example if both were identical, you could append the two arrays to each other and display the resulting data set.&amp;nbsp; Or rather, if the data dictionaries aren&amp;#39;t identical but instead one of them offers more details on members of the other, then in your grid, you could index into the &amp;quot;detail&amp;quot; array for the current member of the &amp;quot;main&amp;quot; array, for example.&amp;nbsp; But without further detail as to what these queries pull, and what you want your grid to show, the only thing I or anyone else will be able to offer is this sort of blind guesswork.&amp;nbsp; Is there any further detail that you can provide?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>