Saltar al contenido principal

Add a row to a table

Pasoadd-rowsaveefectos externos

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

De un vistazo​

PropiedadValor
Nombre del pasoadd-row
RecursoClusterStep (lumen.ai/v1alpha1)
Grupo de la paleta, categoríasave, tables
Créditos1 crédito cada vez que tiene éxito
Efectos externossí Cambia algo fuera de Lumen, así que un reintento pregunta antes y una prueba muestra lo que haría en lugar de hacerlo.
La instalación debe aportarnada

Entradas​

PropiedadValor
Necesitafields
Producefields
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​

Un nodo posterior se refiere a una salida como {nodeId.field} en un texto, o nodeId.field en una condición.

SalidaTipo
rowIdstring
rowCreatedboolean

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
sheetobligatoriostring-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

El JSON Schema completo de estos ajustes: add-row.schema.json.

Ejemplo​

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

Úsalo en un flujo​

Un nodo que ejecuta add-row 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: 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