Pagination help needed to not show same records on multiple pages

We have created a dashboard to showcase data in a table. We are showing 10 records on a page at a time. We want the ability for a user to scroll through 5 pages of records on the dashboard.

The issue we are having is the records aren't unique on each page when scrolling to the next page. You can be on page 1 and then when you go to page 2, you will get new records but you will also see some of the same records from page 1.

Here are some screenshots.
This image is of Page 1

This is page 2 where you will see some of the same rows.

I have enable server side pagination checked on.
Here is what is in my table query.
limit {{ business_view_table.pageSize }}
offset {{ business_view_table.paginationOffset}}

I have tried troubleshooting with different variations of the limit and page offset items but no luck. I feel like this is probably something easy that I am missing.

We are using the Cloud version

Hi @dsteed,

I wanted to ask before you enabled server-side pagination you still had duplicates? Because it could be a problem with the query or the source data.

Also considering that you only need to show 10 records for 5 pages, if the query is not too slow to perform, you could just use client-side pagination.
Which is easier to set up.

You can change it on add-ons of the table then pagination.
Then disable server-side pagination.

I am attaching some screenshots, let me know if it helps :slight_smile:


Hi @Filippo_Galli ,

Thanks for the response. I will give it a try without server side pagination. The source data and query do not contain duplicates.

1 Like

@Filippo_Galli

I turned off server side pagination but it only gives me 10 records and 1 page. It takes away the ability to have 5 pages to scroll through. How do I use client side pagination and still allow a total of 50 rows to show and have 10 rows per page?

@dsteed maybe the query only returned 10 rows because of the limits and offset from the server-side pagination.

Did you remove the

limit {{ business_view_table.pageSize }}
offset {{ business_view_table.paginationOffset}}

from the query?

@Filippo_Galli , we had the same thought. I commented those out but received the same result of only 10 recs and 1 page.

@dsteed ok let me think, 2 things I wanted to ask:

  1. In the query did you check the output and you see all the 50 rows?
  2. if the query is fine if you disabled pagination you can see in the table all the 50 rows?

Yes, I see all 50 rows. If I disable pagination, then it will show a max of 20 rows per page.

Hi @dsteed,

Ok so the query returns 50 rows.
If you link it to the table it displays only 20 rows per page when pagination is disabled.

When there is client-side pagination enabled it displays only 10 records in 1 page and you cannot go through pages, it does not show the option.

can you share some more screenshots or a video about this, because I am trying to think of what it could be, but it might be just a bug in the table component.

I was thinking if you have set some filters on the table, and the data gets filtered?

Or maybe if you did not set a unique the primary key in the table it can cause some issues, like here I set the ID.

Hello @dsteed, welcome to the Retool community forum!
Looking at your table query, have you tried:

limit {{ business_view_table.pagination.pageSize }}
offset {{ business_view_table.pagination.paginationOffset }}

pagination might be what’s missing in your query. If updating that doesn’t work, would you mind sharing your SQL query and how you’ve configured Pagination on the Table component? I'd be happy to take a look!

@ChiEn
Thank you for trying to help out with this issue.
Here is what I currently have at the end of my query.
limit {{ business_view_table.pageSize }}
offset {{ business_view_table.paginationOffset}}

I changed it to what you recommended by adding in pagination but then I get an error: "Result exceeded maximum size of 100 MB"