Set fields
set-fieldscontrolSets, renames or calculates fields without code. A value can mix text with details found, or be a sum such as the total times 1.17. A date can take a layout, such as {email.receivedAt:MM/yyyy} for 10/2026.
Auf einen Blick
| Eigenschaft | Wert |
|---|---|
| Schrittname | set-fields |
| Ressource | ClusterStep (lumen.ai/v1alpha1) |
| Palettengruppe, Kategorie | control, logic |
| Credits | 0.5 Credits 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
More outputs are declared in the setting `fields`.
Einstellungen
Wird unter config: im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie {nodeId.field} enthalten.
| Einstellung | Typ | Standardwert | Beschreibung |
|---|---|---|---|
fieldserforderlich | list of object | - | FieldsminItems 1; maxItems 50 |
fields[].nameerforderlich | string | - | Name is the field, for the steps after this one. A name already there is replaced, so this also renames: set the new name to {old}.minLength 1; maxLength 64; pattern `^[^{}.]+$` |
fields[].valueerforderlich | string | - | A date can be written with a layout: {read.date:MM/yyyy} gives 10/2026. Layouts use yyyy, yy, MM and dd, and MMM for the month name in English (Oct).maxLength 500 |
fields[].type | string | - | Type is what the value is. Unset, it follows the value: a calculation over number fields is a number, anything else is text.one of string, number, date, boolean |
Das vollständige JSON Schema dieser Einstellungen: set-fields.schema.json.
Beispiel
fields:
- name: priceWithVat
type: number
value: '{price} * 1.18'
Im Flow verwenden
Ein Knoten, der set-fields 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: set-fields-example
namespace: tenant-acme
spec:
displayName: "Set fields"
triggers:
- id: start
ref: {name: manual-run}
next: [set-fields]
nodes:
- id: set-fields
stepRef: {name: set-fields}
config:
fields:
- name: priceWithVat
type: number
value: '{price} * 1.18'