<?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>Pagination</title><link>https://community.appian.com/discussions/f/data/26866/pagination</link><description>Hi, 
 I am trying to make an interface wherein I have a read only grid that displays data from a table stored in the database. Now I wrote an expression rule to fetch the data and passed it in the data parameter of the read only grid. 
 
 I want to implement</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105508?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 15:42:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d139fda2-2347-46ad-b371-2eaa177eb261</guid><dc:creator>GautamShenoy</dc:creator><description>&lt;p&gt;Thank you worked&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105507?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 15:32:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8addba31-89dc-4453-8016-96a071355506</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;The grid uses the totalcount value from the datasubset to manage paging. You need to enable this.&lt;/p&gt;
&lt;p&gt;There is so much going wrong here ....&lt;/p&gt;
&lt;p&gt;Remove your manual startIndex calculation. The grid uses the paginginfo to tell the query how much data to fetch. Pass this into the expression and use it accordingly.&lt;/p&gt;
&lt;p&gt;This is a full example of a working paging grid fetching only 5 rows at a time.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!gridField(
  label: &amp;quot;Read-only Grid&amp;quot;,
  labelPosition: &amp;quot;ABOVE&amp;quot;,
  data: a!queryEntity(
    entity: cons!ADM_ENTITY_APPLICATIONS,
    fetchTotalCount: true,
    query: a!query(
      pagingInfo: fv!pagingInfo
    )
  ),
  pageSize: 5,
  columns: {
    a!gridColumn(
      label: &amp;quot;Name&amp;quot;,
      sortField: &amp;quot;name&amp;quot;,
      value: fv!row.name
    )
  },
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105506?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 15:27:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3092cded-de6d-4b1f-884f-df262db928b7</guid><dc:creator>GautamShenoy</dc:creator><description>&lt;p&gt;It is a training.&lt;/p&gt;
&lt;p&gt;The task given was, I need to fetch data from the database in batch format. i.e. 10 rows at a time. Now initially I did the page size thing and it worked fine.&lt;/p&gt;
&lt;p&gt;But then 1 complexity added was to pass only 10 records at a time to the grid and not the entire data from the table. So the page size will not do my job here&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Onto the didn&amp;#39;t work part, I tried passing 10 records, but then It did not show me the &amp;#39;&amp;gt;&amp;#39; key to move to next batch of records. I tried adjusting the records such that I get the &amp;#39;&amp;gt;&amp;#39; key, but then problem was, the &amp;#39;&amp;lt;&amp;#39; key was disabled. Now I can get the next 10 records, but I can&amp;#39;t access the previous 10 records&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105505?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 15:11:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22ceb148-e28d-4463-a0d5-46137f551461</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;FWIW while you&amp;#39;re using an external query and an external PagingInfo that you&amp;#39;ve pre-defined, you never need the read-only grid&amp;#39;s internal &amp;quot;page size&amp;quot; parameter.&amp;nbsp; That&amp;#39;s only needed when you&amp;#39;re having it handle the query internally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105504?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 15:04:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:afe56ac8-d285-41ea-91b0-f7b6276c589e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Is this a test or a training?&lt;/p&gt;
&lt;p&gt;I do not understand your question about the datasubset. The gridfield will manage paging based on the additional values in the datasubset. When you only pass the data part of it, this will not work.&lt;/p&gt;
&lt;p&gt;I missed one important thing? In the initial post you write &amp;quot;&lt;span&gt;it didn&amp;#39;t work&amp;quot;. What exactly did not work?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105503?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 14:59:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e5db75e3-cacc-480c-a60f-0b16bec78aae</guid><dc:creator>GautamShenoy</dc:creator><description>&lt;p&gt;The requirement was given I guess so that we find alternatives of page size,a&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now about the datasubset, I might sound amateur, but wouldn&amp;#39;t it put us in the same problem of putting load on the query ? Like I wanted only 10 records at a time&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pagination</title><link>https://community.appian.com/thread/105501?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 14:50:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:89ce4e66-1c4a-40c3-affe-f783aee0def3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You have a requirement to not use pageSize !?!?! What kind of requirement is that???&lt;/p&gt;
&lt;p&gt;I think the problem is that you only pass the list of items to the grid. To make paging work, it needs a full datasubset. Did you try this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>