Pagination problem on Retool for REST API query resource

Context

  • To start with, I have set limit to be equal to the value of pagination.pageSize and offset to 0 as URL parameters for my REST API query in retool. (calling it query1, to perform a GET action with input value as URL parameters required to retrieve data)

  • In the table with the data from the query1.data.hit, I set the pagination to serverside pagination with pageSize equal to 100 as default, and total row as a result of another query to get the total row counts.

Problem:

  • However, as I have total 119 row counts, the pagination showed 2 pages, the first from 1 to 100, the second also the same, when it should be 101 - 119 instead.

  • And when I change value of another URL parameters, and then clear the selection, the pagination return nothing in my table eventhough the query1.data.hits return data. When I turned off the server-side pagination, this is back to normal.

Appreciate any thoughts on how to fix this. Thanks :pray:

fixed:

  • Page number 2 should have offset calculated to 100 to be able to show records from 101 - 119 instead of 0. Handle the calculation in the variables.
  • The total row counts query needs to be refreshed, too, with URL parameter either equal to the value selection, or empty string. (REST API allow empty string as select all)