Hi,
I have a paging grid which is displaying only 1,175 rows in all environments but from query entity i am getting 3000+ records and from sql query as well. Is there some limitation on the number of rows that are displayed in a paging grid or what could be the reason for this?
TIA!!
Discussion posts and replies are publicly visible
can you please check your database, it contains 3000+ records?
if it is yes, it should be displayed
Can you share your code snippet if possible will find out the problem.
Regards,
Bhanu Prakash
Yes I checked in database it has 3000+ records.
The following is the code snippet:
load(
local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 25, sort: a!sortInfo( field: "A", ascending: false() ),
with( local!datasubset: a!queryEntity( entity: cons!TEST_DS, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "A", operator: "not null" ),a!queryFilter( field: "B", operator: "not in", value: { "Closed", "Complete", } ) } ), pagingInfo: local!pagingInfo ) ),
a!gridField( label: "Sample Report", totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "A", field: "A", data: tointeger( index( local!datasubset.data, "A", null ) )
.
. )
When i pass -1 as batch size, all the 3000+ records are seen in the report but with any other batch size I can see only 1,175 records
Can you try this way,
create a separate query rule and placed here..In that query rule placed startindex:1 and batcsize:-1 but in this rule used (1,25)
with( local!datasubset:todatasubset( rule!queryrule,local!paginginfo),
value:local!pagingInfo.
saveInto:local!paginfinfo
I am using a queryentity and cant make changes and make it as query rule, although queryentity is giving me 3000+ records correctly
Can you check to see if your primary key is unique? Appian should always return the correct number of rows if you use -1 as batch size, but it relies on a count of the IDs for all other batch sizes, so it can return incorrect numbers if the primary key isn't unique.
Even if you don't have a unique field, you may need to create a view that uses a row count field or something to make sure your total counts are correct.
This is a known issue when querying from a View where the View's CDT is configured with a Primary Key column that is not actually unique within the View's data set. In other words, if whatever column you've defined as "primary" in the CDT has duplicates in different rows of the view table, only the unique instances will be counted when returning the paged TotalCount. I don't consider this an error within Appian but rather an error in implementation. The solution to this is to configure your View such that it has at least one column that will always be unique, and configure the CDT for the view to use this column as the Primary Key.