Zum Hauptinhalt springen

Add a row to a table

Schrittadd-rowsaveexterne Wirkung

Adds the details found as a row in one of your tables, or updates the row with the same key.

Auf einen Blick​

EigenschaftWert
Schrittnameadd-row
RessourceClusterStep (lumen.ai/v1alpha1)
Palettengruppe, Kategoriesave, tables
Credits1 Credit bei jedem Erfolg
Externe Wirkungja Er ändert etwas außerhalb von Lumen, deshalb fragt ein Wiederholungsversuch vorher nach, und ein Test zeigt, was er tun würde, statt es zu tun.
Die Installation muss bereitstellennichts

Eingaben​

EigenschaftWert
Brauchtfields
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
rowIdstring
rowCreatedboolean

Einstellungen​

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

EinstellungTypStandardwertBeschreibung
sheeterforderlichstring-Name of the table to add the row to.minLength 1
basestring-Name of the base (database) the table is in. Optional: when set, the table must belong to this base.minLength 1
mappingmap of string-Mapping says what goes in each column: a column name to "{field}" (that field's value), or to text with {placeholders} in it, or to a plain value. A column left out takes the field of the same name.
modestring"insert"Mode is insert (the default: always a new row) or upsert (set the values on the row with the same key, or add one; the Sheet needs a key).one of insert, upsert

Das vollständige JSON Schema dieser Einstellungen: add-row.schema.json.

Beispiel​

config
mapping:
city: '{city}'
contact: '{contact}'
name: '{name}'
status: '{status}'
mode: insert
sheet: Suppliers

Im Flow verwenden​

Ein Knoten, der add-row 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: Connector
metadata:
name: my-webhook
namespace: tenant-acme
spec:
classRef: {name: webhook}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: add-row-example
namespace: tenant-acme
spec:
displayName: "Add a row to a table"
triggers:
- id: start
ref: {name: webhook-received}
connectorRef: {name: my-webhook}
next: [add-row]
nodes:
- id: add-row
stepRef: {name: add-row}
config:
mapping:
city: '{city}'
contact: '{contact}'
name: '{name}'
status: '{status}'
mode: insert
sheet: Suppliers