Appian Queries - Null Total Count

Certified Associate Developer

When I run a query (r18_3 so the total count parameter doesn't exist) with a!pagingInfo(1,-1), it returns total count appropriately. When I substitute a!pagingInfo(1,10), the total count is 0. Does anyone know why this occurs? Looking at the view, the identifiers are sometimes null. Would this affect how the system gets total count? 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'm not 100% certain what's going on in your case, but your guess is probably close - as far as I've seen from personal experience, Appian expects that the column designated as "primary key" in the CDT (whether or not it's actually a primary key in the DB) will be unique and populated for each row.  If that's not the case with your view, I suggest trying to alter the view and/or CDT such that there can be a column which will always have a value and all values in that column will be unique.

  • Yep, if your "primary key" field isn't actually unique, then you can have some strange behavior. Can you create a combined field that would work as a primary key instead? If this is a database view, you could either use the primary key of one of the tables you queried from or create a key by combining data together. For instance, suppose I created a database view to build a line chart that displays a monthly count of records added I could  create a column for the primary key as a concatenation of the year and month (e.g. 201901, 201902), which should be unique.

Reply
  • Yep, if your "primary key" field isn't actually unique, then you can have some strange behavior. Can you create a combined field that would work as a primary key instead? If this is a database view, you could either use the primary key of one of the tables you queried from or create a key by combining data together. For instance, suppose I created a database view to build a line chart that displays a monthly count of records added I could  create a column for the primary key as a concatenation of the year and month (e.g. 201901, 201902), which should be unique.

Children
No Data