Make a CSV file
make-csvfilesTurns a list of rows, for example the rows found in a spreadsheet, into a CSV file that opens in Excel.
Auf einen Blick
| Eigenschaft | Wert |
|---|---|
| Schrittname | make-csv |
| Ressource | ClusterStep (lumen.ai/v1alpha1) |
| Palettengruppe, Kategorie | files, tables |
| Credits | 0.5 Credits bei jedem Erfolg |
| Externe Wirkung | nein |
| Die Installation muss bereitstellen | nichts |
Eingaben
| Eigenschaft | Wert |
|---|---|
| Braucht | fields |
| Liefert | file |
| Arbeitet auf | item einem Dokument nach dem anderen |
Braucht und Liefert sind Datentypen (file, text, fields, email). Der Editor bietet einen Schritt nur dort an, wo das, was er braucht, schon auf dem Pfad liegt. Siehe Dokumente und Daten.
Ausgaben
Keine benannten Ausgaben. Spätere Knoten sehen weiterhin alles, was auf dem Pfad zuvor entstanden ist, und dieser Schritt reicht die Dokumente unverändert weiter.
Einstellungen
Wird unter config: im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie {nodeId.field} enthalten.
| Einstellung | Typ | Standardwert | Beschreibung |
|---|---|---|---|
from | string | - | From is the field that holds the rows; rows (find-row's list) when unset.minLength 1; maxLength 100 |
columns | list 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[].nameerforderlich | string | - | Name is the key in each row (a sheet column's name).minLength 1 |
columns[].title | string | - | Title is the heading in the file; the name when unset.maxLength 200 |
filename | string | - | Filename names the file; it may hold {fields}. export.csv when unset.maxLength 200 |
bom | boolean | true | BOM starts the file with a UTF-8 byte order mark, which Excel needs to read Hebrew; on unless set to false. |
Das vollständige JSON Schema dieser Einstellungen: make-csv.schema.json.
Beispiel
columns:
- name: name
title: Supplier
- name: city
title: City
- name: status
title: Status
filename: suppliers.csv
from: rows
Im Flow verwenden
Ein Knoten, der make-csv ausführt, steht unter spec.nodes eines Flow. Geben Sie ihm eine beliebige id und nennen Sie in next die ids der nächsten Knoten.
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