# Look up a row in a table

> Finds the row in one of your tables that matches, and brings its columns into the steps after it.

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

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Nombre del paso** | `find-row` |
| **Recurso** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Grupo de la paleta, categoría** | read, tables |
| **Créditos** | **1** crédito cada vez que tiene éxito |
| **Efectos externos** | no |
| **La instalación debe aportar** | nada |

## Entradas

| Propiedad | Valor |
| --- | --- |
| **Necesita** | nada |
| **Produce** | `fields` |
| **Trabaja sobre** | item: un documento cada vez |

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta [Documentos y datos](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#documents-and-data).

## Salidas

Un nodo posterior se refiere a una salida como `{nodeId.field}` en un texto, o `nodeId.field` en una condición.

| Salida | Tipo |
| --- | --- |
| `found` | boolean |
| `count` | number |
| `rowId` | string |
| `rows` | array |
| `truncated` | boolean |

More outputs are declared in the setting `returns`.

## Ajustes

Se definen bajo `config:` en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como `{nodeId.field}`.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `sheet` (obligatorio) | 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` (obligatorio) | list of object |  | Where are the tests a row must all pass. (minItems 1; maxItems 8) |
| `where[].column` (obligatorio) | 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` (obligatorio) | 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` (obligatorio) | string |  | (minLength 1) |

El JSON Schema completo de estos ajustes: [find-row.schema.json](https://docs.go-lumen.ai/schemas/steps/find-row.schema.json).

## Ejemplo

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

## Úsalo en un flujo

Un nodo que ejecuta `find-row` va bajo `spec.nodes` de un [Flow](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#the-flow-as-yaml). Dale cualquier id y enumera en next los ids de los nodos siguientes.

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