Endless loop getRows - getTotalRows in collectionlist with pagination

Somehow I get this loop with my getRows query and my getTotalRows query.

I've added the getRows query as data source of a custom collection. I enabled the pagination. I run the query using getTotalRows.trigger() after a successful run of getRows (that seems to be called when the component is rendered) under the event handlers section of the query.

As "Total row count" i've tried this:

{{ getTotalRows.data !== null ? getTotalRows.data.count[0] : 1 }}

What happens is that after getTotalRows has finished, the collection is somehow updated because of the "Total row count" field being updated. This triggers getRows again because it's set to "run query automatically when input changes". So I set this to manually, but then the pagination stops working because it doesn't trigger the getRows anymore. :exploding_head:

Could you share a screenshot of the current setup? Perhaps we can run the "getRows" query manually, and add a Success event handler to run getTotalRows.

Hi Paulo,

Does pagination still works when getRows is set to manual? How would I trigger getRows when "next" is clicked?

What is the normal approach for this? It seemed to me that getRows should run on input-change for pagination to work. In case this should be done manually, then getTotalRows isn't the issue..

Here is a topic were we go over the implementation for this, but we did not take showing a total number of pages, or total row count in consideration. Let me know if you do need it for your use case and we'll find a way. :slightly_smiling_face: