Search bar only searches page 1 when pagination is set

I have a search bar that I’ve created a variable called ‘Search bar debounced’ for, with a workflow that updates the variable’s value when the query is created. My collection is filtered by when my field contains that variable.

I have turned pagination on when querying my data from a Supabase collection, and set it to 25, and added the paginator component to my page.

When I add content to the search bar on the first page, it searches for my value effectively. However, when I move to page 2 and beyond, when I add in a search query to the search bar, the results are blank, even though I can see that the page contains values with that search query.

Any idea why this might be the case?

Thanks!

So im not 100% sure but what might be happening is when you filter the paginated data it looks at the first 25 values in the collection which are null as you are on page 2 filters those and thus returns null. a potential solution would be instead of using the inbuilt filter system by this I mean the filter button use either the formula section to remove nulls from the collection and then filterbykey or some custom js to make it easier to read as it might be a longer formula

The issue could be that your search is not taking the current page into account when querying the data. Typically, when you have pagination, you’ll need to pass the current page number as a parameter to your query, so that the search can filter the results based on the correct page.

1 Like