Saltar al contenido principal

Make a CSV file

Pasomake-csvfiles

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

De un vistazo​

PropiedadValor
Nombre del pasomake-csv
RecursoClusterStep (lumen.ai/v1alpha1)
Grupo de la paleta, categoríafiles, tables
Créditos0.5 créditos cada vez que tiene éxito
Efectos externosno
La instalación debe aportarnada

Entradas​

PropiedadValor
Necesitafields
Producefile
Trabaja sobreitem un documento cada vez

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta Documentos y datos.

Salidas​

Sin salidas con nombre. Los nodos posteriores siguen viendo todo lo producido antes en el camino, y este paso pasa los documentos sin cambios.

Ajustes​

Se definen bajo config: en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como {nodeId.field}.

AjusteTipoValor por defectoDescripción
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[].nameobligatoriostring-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.

El JSON Schema completo de estos ajustes: make-csv.schema.json.

Ejemplo​

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

Úsalo en un flujo​

Un nodo que ejecuta make-csv va bajo spec.nodes de un Flow. Dale cualquier id y enumera en next los ids de los nodos siguientes.

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