Generate CSV New line Issue

Hello all, I am trying to generate a CSV based on some table data, and then send it in an email via SendGrid. I am running into an issue with the CSV generation where the headers will appear on line 1, and then all the row data will appear on line 2, which is not proper CSV formatting, and expects each row entry to be on a new line.

I would just manually generate the CSV string myself, but then I'm not sure how to convert my string to an actual CSV file type.

I've been using this Snippet as reference
https://docs.xano.com/building-features/generating-csv-files

Any ideas here?

3 replies