Getting parse error in server side pagination

Hey
I am using server side pagination in my retool dashboard.
My query looks like this -

select
*
from
{{ formatDataAsArray(postgresQuery.data) }} as d
inner join {{ formatDataAsArray(query4.data) }} as u on d.user_id = u.id
limit {{ table3.pageSize }}
offset {{ table3.paginationOffset }};

Where table3 is the table I have created in retool.

I am getting the following error which I am not able to debug -

message:"Parse error on line 7:
... = u.id limit ? offset ? ;
---------------------^
Expecting 'NUMBER', got 'QUESTION'

I followed this documentation for server side pagination -
https://docs.retool.com/v2.26.11/docs/server-side-paginating-tables#limit---offset-based-pagination

Being stuck on this for last 24 hours. Can someone please help me with this?

Hi Sajal!

This looks like a Query JSON with SQL query right? Where you are joining the results of postgresQuery.data and query4.data. Since those values are already loaded into the browser, why do you need to paginate the results of this Query JSON query?

The table will automatically paginate that locally, likely with better performance than paginating it in this query locally and then displaying the pages in the table. It’s not really possible to do “server side” pagination in this query type because it is used to join/query local values.

1 Like