<?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 much to Query when displaying a few rows at a time in a read-only grid?</title><link>https://community.appian.com/discussions/f/best-practices/17761/how-much-to-query-when-displaying-a-few-rows-at-a-time-in-a-read-only-grid</link><description>Suppose I have a database table 100,000 entries large, and I want to display them in a read-only grid 25 at a time. How can I achieve this, without having to query everything at once? It seems that if I query using the page size (here, 25) then the read</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How much to Query when displaying a few rows at a time in a read-only grid?</title><link>https://community.appian.com/thread/69949?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 14:57:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2cfc4b3c-fb6b-4d0d-8c24-e016d042e419</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="40391" url="~/discussions/f/best-practices/17761/how-much-to-query-when-displaying-a-few-rows-at-a-time-in-a-read-only-grid"]However, since the read-only grid does not have a totalCount parameter, I am unsure of how I can tell the read-only grid that there are still more rows to be queried and displayed.[/quote]
&lt;p&gt;Just to be clear here, I believe you&amp;#39;re misunderstanding how the [new style] read-only grid works.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s correct that it doesn&amp;#39;t have a &amp;quot;totalCount&amp;quot; parameter any more, but it&amp;#39;s&amp;nbsp;&lt;strong&gt;incorrect&lt;/strong&gt; that this means that it doesn&amp;#39;t account for this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the 19.2+ style grid, you would use the&amp;nbsp;&lt;strong&gt;DATA&lt;/strong&gt; parameter for this - at which point you would either pass in a&amp;nbsp;&lt;em&gt;valid query that returns a dataSubset&lt;/em&gt;, or a &lt;em&gt;local variable storing a datasubset&lt;/em&gt;.&amp;nbsp; Both of these will contain a &amp;quot;totalCount&amp;quot; within the data subset, and the Grid component uses that in order to determine the current max size.&amp;nbsp; Note that your query will need to have &amp;quot;fetch total count&amp;quot; turned on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How much to Query when displaying a few rows at a time in a read-only grid?</title><link>https://community.appian.com/thread/69935?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 12:36:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:08b33c29-4236-49d7-8bea-6b464b0e3cf1</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Manual paging shouldn&amp;#39;t be necessary in this case - the standard method of adding the query to the data parameter and using fv!pagingInfo should allow you to query 25 items at a time.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s an example:&amp;nbsp;&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!EMPLOYEE_ENTITY,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: &amp;quot;id&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;firstName&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;lastName&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;department&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;startDate&amp;quot;
            )
          }
        ),
        pagingInfo: fv!pagingInfo
      ),
      fetchTotalCount: true
    ),
    columns: {
      a!gridColumn(
        label: &amp;quot;First Name&amp;quot;,
        sortField: &amp;quot;firstName&amp;quot;,
        value: fv!row.firstName
      ),
      a!gridColumn(
        label: &amp;quot;Last Name&amp;quot;,
        sortField: &amp;quot;lastName&amp;quot;,
        value: fv!row.lastName
      ),
      a!gridColumn(
        label: &amp;quot;Department&amp;quot;,
        sortField: &amp;quot;department&amp;quot;,
        value: fv!row.department
      ),
      a!gridColumn(
        label: &amp;quot;Start Date&amp;quot;,
        sortField: &amp;quot;startDate&amp;quot;,
        value: fv!row.startDate,
        align: &amp;quot;END&amp;quot;
      )
    },
    pagesize: 25,
    initialsorts: {
      a!sortInfo(
        field: &amp;quot;lastName&amp;quot;,
        ascending: true
      )
    }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How much to Query when displaying a few rows at a time in a read-only grid?</title><link>https://community.appian.com/thread/69932?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 10:25:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef7e9c3d-11a3-413e-a41b-d864337d3e36</guid><dc:creator>Gavin Hume</dc:creator><description>&lt;p&gt;I would reconsider the design as paging through 100,000 rows with a page size of 25 would require 4,000 pages, which probably won&amp;#39;t be a good user experience. You might want to consider adding some sort of searching or filtering functionality if you have to be able to display this data in Appian (or find an alternative design to meet your requirement).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How much to Query when displaying a few rows at a time in a read-only grid?</title><link>https://community.appian.com/thread/69922?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 17:27:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8b3456b-d604-49b0-88be-1e33f31bd24a</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;You can use the manual paging option in the grid field configuration.&lt;br /&gt;Refer the tutorial given in (Manual paging section)- &lt;a href="https://docs.appian.com/suite/help/19.3/read-only-grid-configuration.html#query-and-paging-info-in-local-variables"&gt;docs.appian.com/.../read-only-grid-configuration.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Basically, create a local!pagingInfo with start Index 1 and batch size of 25. In the load section write a query entity to query first 25 records and display them in the grid. Use the pagingSaveInto in the a!gridField to save the updated local!pagingInfo and then re-query next datasubset based on this pagingInfo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>