<?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>Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/discussions/f/data/37356/getting-startindex-must-not-be-greater-than-totalcount-issue</link><description>Hi All, 
 We are getting the following error as startindex cannot be greater than totalCount. Start index was 31 and totalcount was 0. We are using process report query for querying the data and for paginginfo, we are using fv!paginginfo. We are getting</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/140013?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 16:28:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:42353d78-2f09-44a2-9886-314d12afb9e1</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Here&amp;#39;s an example with utilizing refresh variables on pagingInfo and data.&amp;nbsp; Paste into a new interface, page over to 11-15, then add any text into the Search box:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!columnValues: {&amp;quot;id&amp;quot;,&amp;quot;userName&amp;quot;,&amp;quot;data&amp;quot;},
  local!columnDisplay: {&amp;quot;ID&amp;quot;,&amp;quot;Name&amp;quot;,&amp;quot;Data&amp;quot;},
  local!search,
  local!pagingInfo: a!refreshVariable(
    value: a!pagingInfo(startIndex: 1,batchSize: 10,sort: a!sortInfo(field: &amp;quot;id&amp;quot;,ascending: false)),
    refreshOnVarChange: {local!search}
  ),
  local!data: a!refreshVariable(
    value: todatasubset(
      a!forEach(
        items: 1+enumerate(if(rule!APN_isEmpty(local!search),15,7)),
        expression: {
          id: fv!index,
          userName: concat(&amp;quot;Name&amp;quot;,fv!index),
          data: concat(&amp;quot;Data&amp;quot;,fv!index)
        }
      )
    ),
    refreshOnVarChange: {local!search}
  ),
  {
    a!textField(
      label: &amp;quot;Search&amp;quot;,
      value: local!search,
      saveInto: local!search,
    ),
    a!gridField(
      data: local!data.data,
      pagingSaveInto: local!pagingInfo,
      columns: {
        a!forEach(
          items: local!columnValues,
          expression: a!gridColumn(
            label: displayvalue(fv!item,local!columnValues,local!columnDisplay,&amp;quot;&amp;quot;),
            value: property(fv!row,fv!item,null)
          )
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/140012?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 14:52:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3a1d462-c63e-4d73-a267-d93dcfaa08a5</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="72415" url="~/discussions/f/data/37356/getting-startindex-must-not-be-greater-than-totalcount-issue/140007"] Do we have to build paging icons separately[/quote]
&lt;p&gt;That&amp;#39;s not what &amp;quot;manage the paging with a local variable&amp;quot; means at all.&lt;/p&gt;
&lt;p&gt;It just means declare a local variable prior to the query i.e. &amp;quot;local!pagingInfo: a!pagingInfo(1, 10),&amp;quot;, which is then fed into the query instead of fv!pagingInfo (in such cases I prefer to query in a separate local variable from the grid itself but I believe either way should work); then anytime the user-controllable filtering is changed, save &amp;quot;1&amp;quot; back into local!pagingInfo.startIndex.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/140007?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 11:49:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a6ac1b94-d223-48eb-af43-104e6a943348</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/tim.clarke"&gt;Tim&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If thats the case, can you please let me know how can the paging achieved dynamically? Do we have to build paging icons separately ( I mean the next page and last page icons). Cause without it, I dont think its possible to achieve it. Would be really helpful if there are any suggestions for this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/140005?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 10:21:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbb21cc7-55d8-4adc-a6f4-8c86562b4c49</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;If you are using custom fields for your filters, which it looks like you are doing with a search text box, you can&amp;#39;t rely on fv!pagingInfo and will instead have to manage the paging with a local variable and therefore reset it any time a user adds a filter value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139990?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 07:35:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a360489-85a7-49dd-97c7-184782717461</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Hi Chris&lt;br /&gt;Sorry for the delay in response. But how we can update startindex to 1 because we are using fv!paginginfo as the paging parameter which is calculated automatically by the grid. When i try to update the startindex to fv!paginginfo, its showing fv!paginginfo as improperly scoped variable. Any suggestion will be helpful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139851?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 17:43:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d1a926f1-a94c-4cb3-8233-7ca18971a2eb</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;We see this error regularly when filters are changed which reduces the data set size, after paging has been used.&amp;nbsp; For instance, if you have a grid with paging set to 10 rows:&lt;/p&gt;
&lt;p&gt;- Current filters return 30 items total, grid shows 1-10&lt;br /&gt;- The user pages to items 11-20&lt;br /&gt;- The user changes filters, which reduces the result set to 8 items&lt;br /&gt;- An error occurs because paging startIndex remains at 11, but there are only 8 items in the new data set&lt;/p&gt;
&lt;p&gt;In that situation, any time the data set can be reduced by filters/etc, the resolution is to manually reset paging startIndex to 1 when any filters are by utilizing a!save().&lt;/p&gt;
&lt;p&gt;Appian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139809?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 05:38:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7bff1464-8a1d-41ce-8649-8d84aa060941</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!queryProcessAnalytics(
  report: cons!REPORT_NAME,
  query: a!query(
    logicalExpression: a!queryLogicalExpression(
      operator: &amp;quot;AND&amp;quot;,
      filters: {
        a!queryFilter(
          field: &amp;quot;c14&amp;quot;,
          operator: &amp;quot;&amp;lt;&amp;gt;&amp;quot;,
          value: loggedInUser(),
          applyWhen: ri!taskAssignement = cons!NAME[2]
        ),
        a!queryFilter(
          field: &amp;quot;c17&amp;quot;,
          operator: &amp;quot;in&amp;quot;,
          value: ri!PM_ID
        ),
      },
      logicalExpressions: {
        a!queryLogicalExpression(
          operator: &amp;quot;OR&amp;quot;,
          filters: {
            a!queryFilter(
              field: &amp;quot;c4&amp;quot;,
              operator: &amp;quot;=&amp;quot;,
              value: ri!search
            )
            
          },
          ignoreFiltersWithEmptyValues: true
        ),
        a!queryLogicalExpression(
          operator: &amp;quot;OR&amp;quot;,
          filters: {
            a!queryFilter(
              field: &amp;quot;c22&amp;quot;,
              operator: &amp;quot;=&amp;quot;,
              value: loggedInUser(),
              applyWhen: ri!taskAssignement = cons!NAME[2]
            ),
            
          },
          ignoreFiltersWithEmptyValues: true()
        )
      },
      ignoreFiltersWithEmptyValues: true
    ),
    pagingInfo: ri!pagingInfo
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the query we are using in the read only grid. We are calling this query in the data parameter of the readonly grid and for ri!paging info, we are passing fv!paginginfo as the value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139807?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 05:11:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ec0326c7-9d08-4f83-b2d4-89a6e38a1336</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;hi &amp;nbsp; &amp;nbsp;could you post your code snippet please that would be better idea&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139805?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 04:06:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0daeb222-4ffb-4705-8f98-6311b260248a</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Unfortunately, this is all the information we have. Additional info is we are using the following query in a dashboard where we show 10 tasks per page in a read only grid. The user can select on those tasks and will assign to themselves and start working on those tasks.&lt;br /&gt;Page size is 10 and paginginfo for the query has been configured as fv!paginginfo.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting StartIndex must not be greater than TotalCount issue</title><link>https://community.appian.com/thread/139801?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2024 14:21:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d5afefe4-000e-469d-9076-0ae471790ce5</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Without more details this is so hard to tell. I think the error message is obvious. If you can shore more, we might come up with ideas what the root cause could&amp;nbsp;be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>