#app with a table with 50k records server side pagination and filters?

1 messages · Page 1 of 1 (latest)

hexed verge
#

hi guys what you recommend me, im going to build an app that have a table with 50k records in postgresql i need to show lets say 10 records only, But will have many filters, when i filter any chance to lookup all 50k records? instead of just the paginated page?

rocky salmonBOT
#

Hey There,

We've registered your query, and our team will get back to you soon.

Regards,
Pranav

rocky salmonBOT
#

Hello! For this you will need to implement custom filtering for your data.
Please refer to our docs
here
for more information about fetching and filtering data from SQL datasources. You
won't be able to use the tables built-in filters for this use case. Instead, you
will need to create external controls using
[Inputs](https://docs.appsmith.com/reference/widgets/input
[https://docs.appsmith.com/reference/widgets/input]) and [Select
widgets](https://docs.appsmith.com/reference/widgets/select
[https://docs.appsmith.com/reference/widgets/select]). Then, you can build your
query dynamically when filters are selected.

This guide shows you how to retrieve and filter data by using a variety of SQL clauses.

Learn how to use the Input widget to gather and validate user input such as text, numbers, emails, and passwords.

Select widget reference

hexed verge
#

yea i know what

#

but when i set own filters and server side pagination, i only can search in the paginated page, not further pages

rocky salmonBOT
#

Please take a look at our docs for setting up server-side
search

for more information.

Thank you for your ongoing support and patience. We aim to provide you with
helpful assistance and hope we have addressed your question adequately.

Please take a moment to share your experience with our support team.
https://survey.frontapp.com/v2/09a400bf433bc9676d67/8e55b8141cbbd7ef7fa1314a11ad42ad
[https://survey.frontapp.com/v2/09a400bf433bc9676d67/8e55b8141cbbd7ef7fa1314a11ad42ad]

This page shows you how to set up server-side searching on the Table widget, which allows you to refine query results based on specific search terms, without relying on the client-side.

hexed verge
#

but when i set own filters and server side pagination, i only can search in the paginated page, not further pages

rocky salmonBOT
#

I don't fully understand the problem. Could you provide a loom.com recording or
elaborate on why you're unable to implement server-side search?

hexed verge
#

I did but when I search by filter something that is on page 2 i cant see it unless im in page 2

#

You know what i mean

rocky salmonBOT
#

I'm afraid not. I gave you guidance to implement external filtering for the
table, as well as server-side search. It was also pointed out that you cannot
make proper use of the built-in table filters when server-side pagination is
enabled, which is why you need external filtering. Please provide a loom.com
recording demonstrating your issue.

hexed verge
#

i will do loom

#

if you see cedula = 8-880-572 is on page #2 but when im in page #1 the search works, but when im in page #2 it doesnt find the 8-880-572

#

SELECT
*
FROM
public.tbl_clientes WHERE cedula LIKE '%{{cedula.value}}%'
LIMIT
{{Table1.pageSize}}
OFFSET
{{Table1.pageOffset}}

#

this is the query

ember maple
#

hey, if you expect to get less records then a page has, you can reset the page of the table to 1, using resetWidget("tablename"). That's bc the way postgresql paginates: if your query returns 2 records, and you ask an offset of 10, it will not return the records

#

I don't know if the recent setters include table.setPageNumber

#

that would also allow you to set the page to 1

#

I'm writing from memory so someone may correct me if I'm wrong

hexed verge
#

how to do that?

ember maple
#

I think you have to learn jsobjects... bind the search box to a js function that resets the table to page 1, and then runs the sql query, similar to the docs but instead of binding the search box to the query directly, instead you run the js function to first reset the table and after run the sql query (https://docs.appsmith.com/build-apps/how-to-guides/Setup-Server-side-Searching-on-Table). By the way I'm a user so just giving my thoughts here

#

maybe there's a better way

hexed verge
#

woh looks complicated

rocky salmonBOT
#

Hello @hexed verge!

@ember maple is correct here, and their analysis of the issue is
accurate. You should create a JS function that resets the table widget with
resetWidget()
and then runs the relevant query. You can then bind that function to your tables
[onSearchTextChanged
event](https://docs.appsmith.com/reference/widgets/table#onsearchtextchanged
[https://docs.appsmith.com/reference/widgets/table#onsearchtextchanged]).

For more information about JS Objects, please refer to our docs
[here](https://docs.appsmith.com/core-concepts/writing-code/javascript-editor-beta
[https://docs.appsmith.com/core-concepts/writing-code/javascript-editor-beta]).

Thank you for your ongoing support and patience. We aim to provide you with
helpful assistance and hope we have addressed your question adequately.

Please take a moment to share your experience with our support team.
https://survey.frontapp.com/v2/09a400bf433bc9676d67/180f38dc7c7bd525e7c626ccc741a849
[https://survey.frontapp.com/v2/09a400bf433bc9676d67/180f38dc7c7bd525e7c626ccc741a849]

Reset a widget to its default state using the resetWidget() Appsmith framework function.

The JavaScript Editor in Appsmith enables you to create JS Objects with a page-level scope. A JS Object is an encapsulation of variables and functions associated with it. It is a template similar to a Java class that contains the variables and the methods used to perform actions.

This page provides information on using the Table widget to display data in tabular format, trigger actions based on user interaction, and work with paginated data sets of any size.

hexed verge
#

i cant bind it to onsearchtext changed, as i will have 5 custom filers, diff textinput, date range, select box

hexed verge
#

also what will happen if user select more than one filter?