Download option is not working properly if there is server side pagination implemented

I am using server side pagination in my application. Download to excel/csv option working within the page scope only, instead of exporting all data from the table it shows the data from the current page only . Server side search also acts like this . Is there a way to overcome this ?

@Ginjo I think this is a known issue. For eg today it is not possible to download all of the serverside paginated data from the available Download button on the Table widget and it only downloads the records on the current page. You’ll have to create a custom Download button for this. Here’s a sample app that you can fork where we have implemented this - Appsmith

@dancia Thanks for the alternate solution for download. I tried with the given function and have some issues. I have a column with comma separated values in it so my csv output is breaking. How can I replace it with any other special character within the function? Also can I include the csv heading as same as in my table widget ? Since my data is fetching from database , the headings will be my database column names and i want it as in my table widget for making it user friendly.

@Ginjo Apologies for the delay. For headings, you can use TableName.tableColumns to extract the table column names using the id field. And for the comma-separated values, check if the link below helps - jquery - How to deal with Commas in CSV using Javascript - Stack Overflow

@dancia Thank you. Will try it let you know.

The shared sheet for doing this refers to 2 google sheets, trying to understand how this works, but the fact they are disconnected from the book when forked leaves me a bit in the dark for replicating.

What are the 2 datasources for exactly? My scenario I have a large set of data (single query) that is to big to bring into Appsmith in one go, so its paginated by the table page, I need users to be able to download this if needed. Just having a hard time wrapping my head around how this all works without being able to see the source data in the forked example.