I’m following this tutorial to convert an input JSON to CSV with the code:
const lines = await JSON.parse(inputData.lines);
const csv = await toCSV(lines);
output = [{ csv }];
Which throws an error
ReferenceError: toCSV is not defined
The incoming payload is
[{"First Name":"First1","Last Name":"Last1","E-mail Address":"first@last1.com","Exam Name":"exam1"},{"First Name":"First2","Last Name":"Last2","E-mail Address":"first@last2.com","Exam Name":"exam2"},{"First Name":"First3","Last Name":"Last3","E-mail Address":"first@last3.com","Exam Name":"exam3"}]
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/405386fe-f436-44fd-aec8-eba530ecbed5.png)
When I remove the second line as done in this question, the output is transposed:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/635a16c7-5ebe-4fd1-a05b-168343deff07.png)
What I would like to get is a single output from the action with:
1
First Name: First1
Last Name: Last1
E-mail Address: first@last1.com
Exam Name: exam1
2
First Name: First2
Last Name: Last2
E-mail Address: first@last2.com
Exam Name: exam2
3
First Name: First3
Last Name: Last3
E-mail Address: first@last3.com
Exam Name: exam3
As is shown in the output of the action:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/0fdd5b39-ff34-4ed5-96a4-0a68906eb4ed.png)