# לקבוע שדות

> קובע, משנה שם או מחשב שדות בלי קוד. ערך יכול לשלב טקסט עם פרטים שנמצאו, או להיות חישוב כמו הסכום כפול 1.17. תאריך יכול לקבל תבנית, כמו {email.receivedAt:MM/yyyy} ל 10/2026.

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

## במבט אחד

| מאפיין | ערך |
| --- | --- |
| **שם השלב** | `set-fields` |
| **משאב** | ClusterStep (`lumen.ai/v1alpha1`) |
| **קבוצה וקטגוריה** | control, logic |
| **קרדיטים** | **0.5** קרדיטים בכל פעם שהוא מצליח |
| **השפעה חיצונית** | לא |
| **ההתקנה צריכה לספק** | כלום |

## קלט

| מאפיין | ערך |
| --- | --- |
| **צריך** | כלום |
| **מפיק** | `fields` |
| **עובד על** | item: מסמך אחד בכל פעם |

״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו [מסמכים ונתונים](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#documents-and-data).

## פלט

More outputs are declared in the setting \`fields\`.

## הגדרות

מגדירים תחת `config:` בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו `{nodeId.field}`.

| הגדרה | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `fields` (חובה) | list of object |  | Fields (minItems 1; maxItems 50) |
| `fields[].name` (חובה) | 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` (חובה) | 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) |

ה-JSON Schema המלא של ההגדרות: [set-fields.schema.json](https://docs.go-lumen.ai/schemas/steps/set-fields.schema.json).

## דוגמה

```yaml title="config"
fields:
- name: priceWithVat
  type: number
  value: '{price} * 1.18'
```

## שימוש בתהליך

צומת שמריץ את `set-fields` נכנס תחת `spec.nodes` של [Flow](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#the-flow-as-yaml). תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.

```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'
```
