Zum Hauptinhalt springen

Merge rows into a spreadsheet

Schrittmerge-rowsfiles

Updates a workbook from one or more source sheets with no AI. Rows are matched on a key column, new keys are added as rows, and anything unclear is reported as a problem instead of guessed.

Auf einen Blick​

EigenschaftWert
Schrittnamemerge-rows
RessourceClusterStep (lumen.ai/v1alpha1)
Palettengruppe, Kategoriefiles, tables
Credits0 Credits bei jedem Erfolg
Externe Wirkungnein
Die Installation muss bereitstellennichts

Eingaben​

EigenschaftWert
Brauchtnichts
Liefertfile, fields
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
filestring
changesarray
addedarray
problemsarray
alertsarray
conflictsarray
changednumber
problemCountnumber
needsReviewboolean
summarystring

Einstellungen​

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

EinstellungTypStandardwertBeschreibung
targeterforderlichobject-Workbook to update
target.filestring-A path in Files (saved/Reports/report.xlsx) or the name of a file of the run. Use either this or the newest in a folder.maxLength 500
target.newestByDateInstring-A folder in Files, such as saved/Reports/.maxLength 500
targetSheetstring-TargetSheet is the target's worksheet; unset is the first.maxLength 31
targetHeaderobject-Header of the workbook
targetHeader.rowinteger-0 finds the row by the text of its first cell.minimum 0; maximum 1000
targetHeader.firstCellstring-FirstCell is the text of the header row's first cell (column A).maxLength 100
keyerforderlichobject-Key
key.targeterforderlichstring-Target is the key column of the target: a header or a letter.minLength 1; maxLength 100
key.sourceerforderlichstring-Source is the key column of every source: a header or a letter.minLength 1; maxLength 100
key.splitstring-Empty is a comma.maxLength 5
sourceserforderlichlist of object-SourcesminItems 1; maxItems 10
sources[].matcherforderlichobject-Which file
sources[].match.fileerforderlichstring-A pattern such as *SHO*.minLength 1; maxLength 200
sources[].sheetstring-Sheet is the source's worksheet; unset is the first.maxLength 31
sources[].headerobject-Header
sources[].header.rowinteger-0 finds the row by the text of its first cell.minimum 0; maximum 1000
sources[].header.firstCellstring-FirstCell is the text of the header row's first cell (column A).maxLength 100
sources[].maperforderlichmap of string-Map is source column to target column, each a header (or a letter).
appendNewbooleantrueAppendNew adds a source row whose keys the target does not have. On unless set to false.
onMissingHeaderstring"report"OnMissingHeader says what a mapped header that is not in a file does: report skips that column and says so, fail stops the step.one of report, fail
sheetNamestring-SheetName renames the target's worksheet; it may hold {today:dd.MM.yyyy}.maxLength 60
filenamestring-Filename names the new file; it may hold {today:dd.MM.yyyy} and {fields}.maxLength 200
langstring-Lang is the summary's language, he or en; empty follows the email.one of , he, en

Das vollständige JSON Schema dieser Einstellungen: merge-rows.schema.json.

Beispiel​

config
filename: '{today:dd.MM.yyyy}.xlsx'
key:
source: Order No
target: Order No
sheetName: '{today:dd.MM.yyyy}'
sources:
- header:
firstCell: Order No
map:
Delivery Date: Delivery Date
Ship Date: Ship Date
match:
file: '*export*'
target:
file: orders-report.xlsx
targetHeader:
firstCell: Order No

Im Flow verwenden​

Ein Knoten, der merge-rows 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: merge-rows-example
namespace: tenant-acme
spec:
displayName: "Merge rows into a spreadsheet"
triggers:
- id: start
ref: {name: manual-run}
next: [merge-rows]
nodes:
- id: merge-rows
stepRef: {name: merge-rows}
config:
filename: '{today:dd.MM.yyyy}.xlsx'
key:
source: Order No
target: Order No
sheetName: '{today:dd.MM.yyyy}'
sources:
- header:
firstCell: Order No
map:
Delivery Date: Delivery Date
Ship Date: Ship Date
match:
file: '*export*'
target:
file: orders-report.xlsx
targetHeader:
firstCell: Order No