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
n{"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"}]
When I remove the second line as done in this question, the output is transposed:
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: