Zum Hauptinhalt springen

Read a spreadsheet

Schrittread-spreadsheetread

Reads the rows of an attached Excel or CSV file, using its first row as the column names. To find rows, give where as column name and text (a part of the cell is enough; use * as the column to search every column, and a number matches with or without leading zeros, so 00069841 finds 69841).

Auf einen Blick​

EigenschaftWert
Schrittnameread-spreadsheet
RessourceClusterStep (lumen.ai/v1alpha1)
Palettengruppe, Kategorieread, tables
Credits1 Credit bei jedem Erfolg
Externe Wirkungnein
Die Installation muss bereitstellennichts

Eingaben​

EigenschaftWert
Brauchtfile
Liefertfields
Arbeitet aufitem 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​

Ein späterer Knoten verweist auf eine Ausgabe als {nodeId.field} in einem Text oder als nodeId.field in einer Bedingung.

AusgabeTyp
rowsarray
countnumber
columnsarray
truncatedboolean
headerRownumber

Einstellungen​

Wird unter config: im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie {nodeId.field} enthalten.

EinstellungTypStandardwertBeschreibung
sheetstring-Sheet is the worksheet to read (an.xlsx; a.csv has one). Unset is the first.maxLength 31
headerRowinteger1HeaderRow is the row that holds the column names. Unset is 1.minimum 1; maximum 1000
maxRowsinteger1000MaxRows is the most rows brought; more is cut off and truncated says so. Unset is 1000.minimum 1; maximum 10000
filestring-A path in Files, such as saved/Price lists/prices.xlsx, a file in a Microsoft 365 connection, connection:<name>/prices.xlsx, or the name of one of the document's files (an email's attachment). Empty reads the first spreadsheet the document carries.maxLength 500
newestCopybooleantrueNewestCopy reads the newest copy save-file made of File. On unless set to false.
findHeaderboolean-FindHeader looks for the column names in the first rows (the row with the most cells filled) instead of HeaderRow: a carrier's export has a few title rows first, at a place that changes.
columnslist of string-Columns keeps only these columns in each row. An agent reading a wide sheet reads it again on every turn; the columns it needs are a fraction of it.maxItems 50
wheremap of string-Column name and the text it holds (a part of the cell is enough; PIRAEUS|RAVENNA means either). Use * as the column to search every column. A number ignores leading zeros: 00069841 finds 69841.

Das vollständige JSON Schema dieser Einstellungen: read-spreadsheet.schema.json.

Beispiel​

config
headerRow: 1

Im Flow verwenden​

Ein Knoten, der read-spreadsheet 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.

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: read-spreadsheet-example
namespace: tenant-acme
spec:
displayName: "Read a spreadsheet"
triggers:
- id: start
ref: {name: manual-run}
next: [read-spreadsheet]
nodes:
- id: read-spreadsheet
stepRef: {name: read-spreadsheet}
config:
headerRow: 1