# Set fields

> Sets, 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.

Source: https://docs.go-lumen.ai/de/reference/steps/set-fields

## 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](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#documents-and-data).

## 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 |
| --- | --- | --- | --- |
| `fields` (erforderlich) | list of object |  | Fields (minItems 1; maxItems 50) |
| `fields[].name` (erforderlich) | 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[].value` (erforderlich) | 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](https://docs.go-lumen.ai/schemas/steps/set-fields.schema.json).

## Beispiel

```yaml title="config"
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](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#the-flow-as-yaml). Geben Sie ihm eine beliebige id und nennen Sie in next die ids der nächsten Knoten.

```yaml title="flow.yaml"
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'
```
