Look up a row in a table
find-rowreadFinds the row in one of your tables that matches, and brings its columns into the steps after it.
Auf einen Blick
| Eigenschaft | Wert |
|---|---|
| Schrittname | find-row |
| Ressource | ClusterStep (lumen.ai/v1alpha1) |
| Palettengruppe, Kategorie | read, tables |
| Credits | 1 Credit bei jedem Erfolg |
| Externe Wirkung | nein |
| Die Installation muss bereitstellen | nichts |
Eingaben
| Eigenschaft | Wert |
|---|---|
| Braucht | nichts |
| Liefert | fields |
| Arbeitet auf | item 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.
| Ausgabe | Typ |
|---|---|
found | boolean |
count | number |
rowId | string |
rows | array |
truncated | boolean |
More outputs are declared in the setting returns.
Einstellungen
Wird unter config: im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie {nodeId.field} enthalten.
| Einstellung | Typ | Standardwert | Beschreibung |
|---|---|---|---|
sheeterforderlich | string | - | Name of the table to look the row up in.minLength 1 |
base | string | - | Name of the base (database) the table is in. Optional: when set, the table must belong to this base.minLength 1 |
whereerforderlich | list of object | - | Where are the tests a row must all pass.minItems 1; maxItems 8 |
where[].columnerforderlich | string | - | minLength 1 |
where[].op | string | "eq" | Op is eq (the default), contains (text, case-insensitive), or gt, gte, lt, lte (numbers, amounts and dates).one of eq, contains, gt, gte, lt, lte |
where[].valueerforderlich | string | - | |
all | boolean | - | All brings back every match, up to limit, as the list field rows. The first match is always the fields. |
limit | integer | - | Limit is how many rows all brings back; 50 when unset, 10000 at most. When more rows match, the output truncated is true.minimum 1; maximum 10000 |
prefix | string | - | Prefix goes before each column name in the fields, so a looked-up value does not replace a field of the same name.maxLength 32 |
returns | list of object | - | Returns lists the columns later steps will use, so the editor can offer them. All of the row's columns are brought back either way.maxItems 100 |
returns[].nameerforderlich | string | - | minLength 1 |
Das vollständige JSON Schema dieser Einstellungen: find-row.schema.json.
Beispiel
returns:
- name: contact
- name: city
- name: status
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'
Im Flow verwenden
Ein Knoten, der find-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.
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: find-row-example
namespace: tenant-acme
spec:
displayName: "Look up a row in a table"
triggers:
- id: start
ref: {name: manual-run}
next: [find-row]
nodes:
- id: find-row
stepRef: {name: find-row}
config:
returns:
- name: contact
- name: city
- name: status
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'