I have a data app and enabled download as CSV, but it does not contain the header rows after downloading. I see that if you select other output options like JSON or XML, the headers are there but I don't see an option to add headers for CSV output.
-
Hi Brandon,
The workaround you used is definitely usable in many use-cases and I'm sure a preferable one in many. Just for the record, there is indeed no button to enable the header row to be written out.
Another workaround is to manually iterate through the record fields and write out the column names as a regular record. You can use a DataGenerator component for this. You'll need to use phases to make sure the column names are going to be the first record in the resulting file. Then you can use a SimpleGather component to join the records one after another, more specifically, the names first and the actual data after that.
Since our forum platform doesn't allow for sharing files other than images, attached is a link to FileTrasfer.io website that contains a file called test.rjob that demonstrates this technique and should give you a better idea on the concept.
https://filetransfer.io/data-package/L64MrpF2#linkKind regards,
Lukas
-
After further playing with this. I added a datawriter, choosing to write field names and set the file output to response:body. Then remove any output edges, and change the DataApp output to custom, text/csv. Now I have a download file with headers. You loose the web preview of the data before downloading, but at least I have headers now. Just incase this helps someone.
Please sign in to leave a comment.
Comments 2