CSVFileWrite generates CSV with the input payload as input.

The input payload (cv.Payload) accepts input as an array of JSON arrays or an array of JSON Objects. Otherwise, it converts it to a string and outputs it as a one-line, one-column CSV file.

Input payload Example
Example of JSON array payload [[123, "foo", "bar"], [456, "jane", "doe"], [789, "john", "doe"]]
Example of JSON Object payload [{"field1": 123, "field2": "abc", "field3": "xxx"}, {"field1": 456, "field2": "def", "field3": "yyy"}, {"field1": 789, " field2": "hij", "field3": "zzz"}]

component properties

Property name Description
File Name Specify the file name in case of file output
Append If true, appends data to the file if it already exists; if false, overwrites the file
Output Keys If the input payload is a JSON Object, list the field names to be output in the order you want them to be output, separated by commas.
Encoding Specify the encoding of the file output.

If the file path is not specified, the file is saved in actmgr/data. For how to refer to a file path, refer to this part.

How to use the Output Keys

The output keys specify the order, in which the data will be written to the CSV if you use keys.

For example, when the payload of JSON Object is as follows

[{"field1": 123, "field2": "abc", "field3": "xxx"}, {"field1": 456, "field2": "def", "field3": "yyy"}, {"field1": 789, "field2": "hij", "field3":" zzz"}]

and you specify field3, field1 as the output field order, the CSV output will be:

xxx,123
yyyy,456
zzz,789

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.