<?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 have two different Paging Grids on the same interface?</title><link>https://community.appian.com/discussions/f/user-interface/13463/how-can-i-have-two-different-paging-grids-on-the-same-interface</link><description>Hi All, 
 I&amp;#39;m less than two weeks of working with SAIL and I have a paging grid on my interface (which is working as I want to). Very happy about that, thanks mostly to the support I have received from this forum. However, I need to include a different</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61230?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 13:39:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7880e20c-6a07-4869-8a50-c7274ba751f1</guid><dc:creator>laurenc20</dc:creator><description>As long as all variables used in the grids are specified for the grid with the desired data, you can have many grids on one interface. The more description your local variables are and expression rules with the queries, the easier it will be for someone else to understand your code later.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61224?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 12:17:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb53fa44-4172-4bb2-8243-5c730b4bb1d4</guid><dc:creator>Mike Lasutschinkow</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is possible to combine datasubsets, such as the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=load(
  local!ds1: rule!query1(),
  local!ds2: rule!query2(),
  local!pagingInfo: topaginginfo(1,10),
  with(
    local!datasubset: todatasubset(
       {
         local!ds1.data,
         local!ds2.data
       },
       local!pagingInfo
    ),
    a!gridField(
      value: local!pagingInfo,
      saveInto: local!pagingInfo,
      totalCount: local!datasubset.totalCount,
      columns: {...}
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, this requires querying all data up front, so whenever possible you should look into using a view to combine the datasets you are working with rather than doing it like this on-form.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61212?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 05:43:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae62e833-4a63-426d-bdbe-02bf9827d5fc</guid><dc:creator>geervanim</dc:creator><description>Hi friends,&lt;br /&gt;
&lt;br /&gt;
Is it possible to append two datasubsets  and show it in the single grid  which is total count differen?&lt;br /&gt;
&lt;br /&gt;
Business Case:   Initially the application was task based , now client wants it to be record based.&lt;br /&gt;
I have added the related actions.&lt;br /&gt;
Now I want to show all the active tasks from old report ( which is from task based ), new tasks from the related actions .&lt;br /&gt;
I am unable to do this because of the total count issue.&lt;br /&gt;
&lt;br /&gt;
In my old report I have 3 tasks and new report I have 6 tasks. &lt;br /&gt;
And if suppose I give the batchsize=3 .&lt;br /&gt;
&lt;br /&gt;
I am getting the below error&lt;br /&gt;
A grid component [label=“”] has an invalid value for “value” and “totalCount”. “startIndex” must not be greater than “totalCount”, but “startIndex” was 4 and “totalCount” was 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is code&lt;br /&gt;
&lt;br /&gt;
load(local!pagingInfo: a!pagingInfo(&lt;br /&gt;
    startIndex: 1,&lt;br /&gt;
    batchSize:3&lt;br /&gt;
),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
&lt;br /&gt;
/*  Fetching the datasubsets here */&lt;br /&gt;
&lt;br /&gt;
  local!tempData:append(index(local!datasubsetOldTaskList,&amp;quot;data&amp;quot;),&lt;br /&gt;
    index(local!datasubsetNewTaskList,&amp;quot;data&amp;quot;)&lt;br /&gt;
    ),&lt;br /&gt;
    local!tempDataSubset: todatasubset(&lt;br /&gt;
      local!tempData, local!pagingInfo&lt;br /&gt;
     ))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61027?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 21:53:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d342005c-8d5f-4011-917e-cd5ad5594e30</guid><dc:creator>susana197</dc:creator><description>Thanks all for your kind answers and code samples.  I have set it up for two grids on a page thanks to you.  Enjoy the rest of your day(s).&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61010?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 18:45:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b2d768cb-e5bd-4090-8b58-e1c521dd5400</guid><dc:creator>Mike Lasutschinkow</dc:creator><description>&lt;p&gt;If you want to be more careful about performance, you can page the queries themselves instead of moving paging into the with() block. Something like&amp;nbsp; the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;=load(
  local!firstPagingInfo,
  local!secondPagingInfo,
  local!firstQuery: rule!query(pagingInfo: local!firstPagingInfo),
  local!secondQuery: rule!query(pagingInfo: local!secondPagingInfo),
  
  {
    /* first grid */
    a!gridField(
      value: local!firstPagingInfo,
      saveInto: {
        local!firstPagingInfo,
        a!save(
          local!firstQuery,
          rule!query(pagingInfo: local!firstPagingInfo)
        )
      }
    ),
    /* second grid */
    a!gridField(
      value: local!secondPagingInfo,
      saveInto: {
        local!secondPagingInfo,
        a!save(
          local!secondQuery,
          rule!query(pagingInfo: local!secondPagingInfo)
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61009?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 18:39:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87f16ee3-c510-40a3-9a44-88d3c8f7e8b9</guid><dc:creator>omere0001</dc:creator><description>&lt;p&gt;I would recommend having your queries in load() local variables rather than inside with(). When a component inside the with() is interacted with, all of the variables are recalculated, so both of your queries would be re-queried anytime you sort or page. Here is another way to structure your SAIL code to be better performant.&lt;br /&gt; &lt;br /&gt; load(&lt;br /&gt; local!firstQuery,&lt;br /&gt; local!secondQuery,&lt;br /&gt; local!firstpagingInfo,&lt;br /&gt; local!secondPagingInfo,&lt;br /&gt; &lt;br /&gt; with(&lt;br /&gt; local!firstDataSubset: todatasubset(local!firstQuery, local!firstPagingInfo),&lt;br /&gt; local!secondDataSubset: todatasubset(local!secondQuery, local!SecondPagingInfo),&lt;br /&gt; {&lt;br /&gt; /*First Paging Grid*/&lt;br /&gt; a!gridField()&lt;br /&gt; &lt;br /&gt; /*Second Paging Grid*/&lt;br /&gt; a!gridField()&lt;/p&gt;
&lt;p&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 have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61003?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 17:38:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d721f83f-20d4-44d2-b3bf-2194ed948f39</guid><dc:creator>Mike Lasutschinkow</dc:creator><description>&lt;p&gt;As the other users have said, the main takeaway here is that &amp;quot;local!pagingInfo&amp;quot;&amp;nbsp;and &amp;quot;local!dataSubset&amp;quot; are just variable names and could be renamed to anything else.&lt;br /&gt; &lt;br /&gt; One practice I find helpful is to name my paging infos according to the data type they will be paging. So if I have a form with one grid of documents and one grid of contracts, for example, I will name my variables local!documentPagingInfo and local!contractPagingInfo, and name my datasubsets similarly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61002?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 17:34:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fdf0ce37-d051-410e-85fe-2c766cbb8529</guid><dc:creator>weronikak6206</dc:creator><description>Good point. Essentially, your code should look like this (I modified some variable names to make it clearer):&lt;br /&gt;
&lt;br /&gt;
=load(&lt;br /&gt;
  local!firstPagingInfo: a!pagingInfo(...),&lt;br /&gt;
  local!secondPagingInfo: a!pagingInfo(...),&lt;br /&gt;
  with(&lt;br /&gt;
    local!firstDatasubset: a!queryEntity(&lt;br /&gt;
      entity: ... ,&lt;br /&gt;
      query: a!query(&lt;br /&gt;
      ...&lt;br /&gt;
      pagingInfo: local!firstPagingInfo&lt;br /&gt;
      )&lt;br /&gt;
    ),&lt;br /&gt;
    local!secondDatasubset: a!queryEntity(&lt;br /&gt;
      entity: ... ,&lt;br /&gt;
      query: a!query(&lt;br /&gt;
      ...&lt;br /&gt;
      pagingInfo: local!secondPagingInfo&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61001?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 17:02:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76e928bd-a2cf-4455-a775-5960a1be7121</guid><dc:creator>seanw583</dc:creator><description>I&amp;#39;d also add that you&amp;#39;ll need another pagingInfo variable, which should go in the load().&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I have two different Paging Grids on the same interface?</title><link>https://community.appian.com/thread/61000?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 16:59:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e299903d-5cde-4ad0-adf8-22f7c4f26ae0</guid><dc:creator>weronikak6206</dc:creator><description>Hi, You can definitely have a second query defined in the with(), you would just need to put it below the definition for the local!datasubset variable, and give it a different name.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>