# Need help exporting to CSV file

**URL:** <https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [January 25, 2025, 9:08pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965 "2025-01-25T21:08:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user1812](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/user1812/32/89867_2.png) [@user1812](https://forum.wixstudio.com/u/user1812)\
**Post date:** [January 25, 2025, 9:08pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965/1 "2025-01-25T21:08:52Z")

</div>

**Question:**  
I have an “app” on my site that allows people to manage goals and actions relating to a mentorship. Goals are related to actions as 1 to many via multi reference. I have an exportButton that initiates a CSV export. I then flatten the data included in both of these collections to prepare the data. But then I run into a dead end. I have no idea how to actually initiate an export in CSV format. I have the final flattened data in finalData object and need to know where to go from here.

**Product:**  
Editor

**What are you trying to achieve:**  
Export finalData flattened data to a CSV file.

**What have you already tried:**  
Nothing other than getting the data prepared - I do not know where to go from here.

**Additional information:**  
No additional info.

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [January 25, 2025, 10:43pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965/2 "2025-01-25T22:43:11Z")

</div>

Hi Ted 👋!

What do you mean export button? Is this a button within this “app”? Or is it the native Export function located on the CMS database collection settings?

If it’s the native button within the database then select “Export” all fields and when your window to Save and Name the file pops open , just hit Save and it will be in CSV format.

---

<div class="post-metadata">

**Author:** ![user1812](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/user1812/32/89867_2.png) [@user1812](https://forum.wixstudio.com/u/user1812)\
**Post date:** [January 25, 2025, 11:10pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965/3 "2025-01-25T23:10:26Z")

</div>

Hi Nayelli!

This is code - in the app I created on my site I have added an exportButton that I want the user to be able to click to export all the goals and actions in their mentorship plan. The code I have so far takes the two collections and flattens the data for export. But I do not know how to actually get the data exported to a CVS file. Thanks!

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [January 25, 2025, 11:14pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965/4 "2025-01-25T23:14:19Z")

</div>

Oooooooooooo. I understand now.

Try this thread, it has several links to samples ….

> [@Programatically exporting Collections as CSV with Wix Velo (Code)](https://forum.wixstudio.com/t/programatically-exporting-collections-as-csv-with-wix-velo-code/54511):
>
> Hi everyone After a lot of research I have finally found a solution to this problem. Custom element code: class CSVDownloader extends HTMLElement { static get observedAttributes() { return ['csv-data']; } attributeChangedCallback(name, oldValue, newValue) { if (name === 'csv-data') { this.csvContent = newValue; this.querySelector('#download-button').style.display = 'block'; // Zeigt den Button an } } constructor() { …

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [January 25, 2025, 11:17pm UTC](https://forum.wixstudio.com/t/need-help-exporting-to-csv-file/67965/5 "2025-01-25T23:17:45Z")

</div>

1. [How to download the contents of a data collection in a csv file - #16 by cwvega76](https://forum.wixstudio.com/t/how-to-download-the-contents-of-a-data-collection-in-a-csv-file/13533/16)

2. [Let visitors export dataset to excel (solved!) include Hebrew](https://forum.wixstudio.com/t/let-visitors-export-dataset-to-excel-solved-include-hebrew/21534)

3. You will find more stuff like this…

EDIT: → maybe this aswell…

> [@CSV build issue - HELP!](https://forum.wixstudio.com/t/csv-build-issue-help/58369/13):
>
> You can also use a CSV NPM if you want to do it from the backend.

There are different ways, but you should prefere the BACKEND-VERSION!
