Skip to main content

Make a CSV file

Stepmake-csvfiles

Turns a list of rows, for example the rows found in a spreadsheet, into a CSV file that opens in Excel.

At a glance​

PropertyValue
Step namemake-csv
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categoryfiles, tables
Credits0.5 credits each time it succeeds
Side effectsno
Installation must providenothing

Inputs​

PropertyValue
Needsfields
Producesfile
Works onitem one document at a time

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See Documents and data.

Outputs​

No named outputs. Later nodes still see everything produced earlier on the path, and this step passes the documents on unchanged.

Settings​

Set under config: on the flow node. Text settings may contain {nodeId.field} placeholders.

SettingTypeDefaultDescription
fromstring-From is the field that holds the rows; rows (find-row's list) when unset.minLength 1; maxLength 100
columnslist of object-Columns are the columns to write, in order, with their headings. When unset every key the rows have is written, in the order they first appear (rowId first when the rows have one).maxItems 200
columns[].namerequiredstring-Name is the key in each row (a sheet column's name).minLength 1
columns[].titlestring-Title is the heading in the file; the name when unset.maxLength 200
filenamestring-Filename names the file; it may hold {fields}. export.csv when unset.maxLength 200
bombooleantrueBOM starts the file with a UTF-8 byte order mark, which Excel needs to read Hebrew; on unless set to false.

The full JSON Schema of these settings: make-csv.schema.json.

Example​

Turn three supplier rows into a CSV file

config
columns:
- name: name
title: Supplier
- name: city
title: City
- name: status
title: Status
filename: suppliers.csv
from: rows

Use it in a flow​

A node that runs make-csv goes under spec.nodes of a Flow. Give it any id, and list the next node ids in next.

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-webhook
namespace: tenant-acme
spec:
classRef: {name: webhook}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: make-csv-example
namespace: tenant-acme
spec:
displayName: "Make a CSV file"
triggers:
- id: start
ref: {name: webhook-received}
connectorRef: {name: my-webhook}
next: [make-csv]
nodes:
- id: make-csv
stepRef: {name: make-csv}
config:
columns:
- name: name
title: Supplier
- name: city
title: City
- name: status
title: Status
filename: suppliers.csv
from: rows