How to export data to CSV?

So, looking through the forums for several years HOW DOES ONE USE the EXPORT CSV Action?
I'm working a php & mysql project.

The path selector using the Folder icon does not work the way I'm sure was intended.
If I try using the Folder icon to pick the folder I have made in the project /csvexport the OPEN (and save the choice ) does not activated.

Getting past that problem I typed in the path to the folder I had tried to choose by the folder icon component.
I assumed would not use the actual File Name and .csv extension type -- as in /csvexport/trainingsform.csv.-- since Wappler specifies only PATH.

But, the subsequent output debug showed me

/dmxConnectLib/modules/export.php","line":29,"message":"Data is not an array.","trace":"#0

Since I selected the Wappler API component that also gave a choice of the Delimiter I assumed that the code in this api knew what to do with the output of a multiple row Wappler query that had no special conditions or filters applied.

I cannot tell from the years of Forum posts about problems with this whether this is a once existing bug that was fixed or whether it needs the user to devise their own code solution.

I see problems on both of your screenshots.

  1. The path must be the path to the file you want to export, like /folder/file.csv
  2. Export data must be a collection/array - in your case the database query.

That’s all. Nothing too complicated at all, as your post makes it look.

Thank you, @Teodor !

When filling in so many other programs when they asked for Path they asked the path to the folder where the file was to be placed.

The file name was created in another line.

But thank you for clearing that up!

By the way, in one forum post I saw Wappler notifying Users that this export could only go to the Project Settings “User Uploads Folder”. But I assume this is not the case now.

Now I find this from 2020. I was looking in the Docs for this.

This has nothing to do with the export to csv option.

1 Like

After setting this up, how then do you set a button to download the file?

I've been facing some troubles during some download test, but not fully inspect it.

Check if this approach is good for you using a set value and browser component: