Download button for downloading CSV data

Hello,

I want to add a button to my page such that when we click on the button, it reads my database and downloads some data in the CSV format.

I found that we can link a button to download any document that is uploaded. But how can we write code so that the button downloads data from my database.

Thank you.

Only the Admin/Owner can export data from a dataset as a CSV file.
https://support.wix.com/en/article/exporting-data-from-a-database-collection

You can have an image shown on the document button as well through the Editor.
https://support.wix.com/en/article/changing-the-icon-on-a-document-button

You can use code to do it here.
https://support.wix.com/en/article/corvid-tutorial-importing-and-exporting-collection-data-with-code

Once the read the data with code, how can i download that for the user ?