# לחפש שורה בטבלה

> מוצא בטבלה את השורה שמתאימה, ומביא את העמודות שלה לשלבים שאחריו.

Source: https://docs.go-lumen.ai/he/reference/steps/find-row

## במבט אחד

| מאפיין | ערך |
| --- | --- |
| **שם השלב** | `find-row` |
| **משאב** | ClusterStep (`lumen.ai/v1alpha1`) |
| **קבוצה וקטגוריה** | read, tables |
| **קרדיטים** | **1** קרדיט בכל פעם שהוא מצליח |
| **השפעה חיצונית** | לא |
| **ההתקנה צריכה לספק** | כלום |

## קלט

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

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

## פלט

צומת מאוחר יותר מפנה לפלט כ-`{nodeId.field}` בטקסט, או כ-`nodeId.field` בתנאי.

| פלט | סוג |
| --- | --- |
| `found` | boolean |
| `count` | number |
| `rowId` | string |
| `rows` | array |
| `truncated` | boolean |

More outputs are declared in the setting `returns`.

## הגדרות

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

| הגדרה | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `sheet` (חובה) | 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) |
| `where` (חובה) | list of object |  | Where are the tests a row must all pass. (minItems 1; maxItems 8) |
| `where[].column` (חובה) | 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[].value` (חובה) | 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[].name` (חובה) | string |  | (minLength 1) |

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

## דוגמה

```yaml title="config"
returns:
- name: contact
- name: city
- name: status
sheet: Suppliers
where:
- column: name
  op: eq
  value: '{supplier}'
```

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

צומת שמריץ את `find-row` נכנס תחת `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: 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}'
```
