Need help exporting to CSV file

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.

Hi Ted :wave:!

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.

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!

Oooooooooooo. I understand now.

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

1 Like
  1. How to download the contents of a data collection in a csv file - #16 by cwvega76

  2. Let visitors export dataset to excel (solved!) include Hebrew

  3. You will find more stuff like this…

EDIT: → maybe this aswell…

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

1 Like