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.

@dancia Tried with the solution you given above for get table headers , but it didn’t work. Can you give a sample code for this ?