Create CSV
We will create a simple flow that creates a csv file.
-
Create a new project from Flow Designer
-
Create the following flow by drag-and-dropping the nodes from the node palette, or by right clicking on the empty board, you can search the nodes by name.
- Below is the list of nodes used in this flow:
- Trigger -> Inject
- Programming -> Function
- CSV -> Write CSV
- Programming -> Debug
- Double-click the "Prepare Table" sub flow node and click the Edit action menu item on the "Prepare Table" named Function node,
then copy paste the below script and press Save.
msg.table = {
columns:["model", "year", "price"],
rows:[
{"model":"hyundai", "year":1929, "price":"$4.9"},
{"model":"bmw", "year":1980, "price":"$9.9"}
]
}
return msg;
note
This is the structure used by CSV nodes both used by write and append CSV nodes.
- Click "Write CSV" node and change the node's properties as follows:
note
Do not forget to change the "File Path" according to your path
- Run this flow and check out the created csv file.