How to use "Selected Page" for Server Side Pagination

Hi,

Does anyone know how the "Selected Page" within the server-side pagination section works? I'm looking for methods for a server-side pagination table to flip to a designated page.
Thank you for the help :slight_smile:

Take a look here:
Working with tables

Thank you for the reply. I checked the document but it doesn't specify how "Selected Page" is used. I tried to change the "Selected Page" value but it doesn't seem to change the query output. :thinking:

@doris.l

The Selected Page value should set the initially selected page with an initial offset, but it looks like it isn't working at the moment. I just created a bug report and tied it to this thread so that I can keep you posted as progress is made. Thank you for pointing this out!

It's been a year since the last update to this post, and the "Selected page" bug still appears unresolved. When can we expect a solution? As things stand, there doesn't appear to be any (documented) way to use limit/offset-based server-side pagination with the table component.

Hey @jgingold, pagination in Retool should work, actually!

https://docs.retool.com/docs/server-side-pagination

It's just the "Selected Page" input that doesn't seem to be doing much :sweat_smile: I just checked in on that bug report.

In the meantime, let me know if you have any questions about getting pagination set up. Happy to help!

Any update on the input "selected page"? still doesn't work

Hey Mary! No update on "selected page" just yet, but we do have a new way of doing pagination in our new Table component :slight_smile:

https://docs.retool.com/docs/optimize-queries-with-server-side-pagination#limit-and-offset

1 Like

Hello @victoria where is this option in retool? I can't find it.

Hey Sofia! Great question. Here's a section in our docs that goes over it.

1. Click your Table to open up the right page inspector

2. Click the plus sign by "Add-ons"

3. Click "Pagination"!

Let me know if this helps :slight_smile:

thank you for the answer. But should I also include the pagination in the query?
I'm seeing this warning:
image

Yup! Your query should look something like this:

select id, first_name, last_name, email from customer where first_name ilike {{ '%' + textinput1.value + '%' }}
order by id
limit {{ table1.pagination.pageSize }}
offset {{ table1.pagination.offset }}

https://docs.retool.com/queries/guides/server-side-pagination

1 Like

@victoria Hope you don't mind me also jumping into the conversation as I am trying to apply pagination to some queries & tables I got but having trouble.

So for example I am trying to query a table with 3,683 records. I have applied a count query to the pageSize element and used the offset one as well (not sure where it is defined).
When trying to run the query with both of these I am getting the error attached

Would love your help as I really need to move forward from limiting the table with a number

Screenshot 2023-12-06 at 13.29.56

thank you for the answer @victoria . But i'm using dynamo so this doesn't work. Do you have a solution for it?

Hey Sofia! Sorry for the delayed reply. Would this post be helpful? Let me know if you get stuck anywhere else :slight_smile:

https://community.retool.com/t/how-to-perform-server-side-pagination-on-a-dynamodb-table/21529