> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/automation-areas/tables-v2/get-rows.md).

# Rows

Retrieves a single row or multiple rows from a table.

### Overview

This procedure gets a single row or multiple rows from a table. Optionally, a row selection formula can be specified to narrow the retrieval.

{% hint style="info" %}
You can retrieve all rows from the table.
{% endhint %}

### Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

<details>

<summary><code>get the table's row(s)</code></summary>

#### What does it do?

Instructs the system to get one or more rows from a table. If a single-row request returns multiple rows, a question will be raised, prompting you to select one.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — A reference to **the table** must be defined in the automation.

</details>

<details>

<summary><code>the row selection formula is</code></summary>

#### What does it do?

None

#### Where does it go?

Indented under `get the table's row(s) where`.

#### Is it required?

❌ No — This phrase is **optional**.

#### Does it require data?

❌ No — This phrase does not require data.

</details>

### Examples

#### 1. Get a Single Row

{% tabs %}
{% tab title="Automation" %}

```
create an sample table
get the table's row
```

{% endtab %}

{% tab title="Results" %}
A question is raised saying **Multiple rows found, please select a row to continue**.
{% endtab %}
{% endtabs %}

#### 2. Get a Single Row Using a Row Selection Formula

{% tabs %}
{% tab title="Automation" %}

```
create an sample table
get the table's row where
    the row selection formula is "Name == john"
```

{% endtab %}

{% tab title="Results" %}

| Name          | Number             | Address         | City          |
| ------------- | ------------------ | --------------- | ------------- |
| john          | + 1 (415) 691 9426 | 123 east street | San Francisco |
| {% endtab %}  |                    |                 |               |
| {% endtabs %} |                    |                 |               |

#### 3. Get Multiple Rows

{% tabs %}
{% tab title="Automation" %}

```
create an sample table
get the table's rows
```

{% endtab %}

{% tab title="Results" %}
**the rows**

| Address          | City          | Name | Number             |
| ---------------- | ------------- | ---- | ------------------ |
| 123 east street  | San Francisco | john | + 1 (415) 691 9426 |
| 321 west street  | San Jose      | joe  | + 1 (415) 691 1234 |
| 213 north street | San Francisco | jack | + 1 (415) 691 4595 |
| {% endtab %}     |               |      |                    |
| {% endtabs %}    |               |      |                    |

#### 4. Get Multiple Rows Using a Row Selection Formula

{% tabs %}
{% tab title="Automation" %}

```
create an sample table
get the table's rows where
    the row selection formula is "City == San Francisco"
```

{% endtab %}

{% tab title="Results" %}
**the rows**

| Name          | Number             | Address          | City          |
| ------------- | ------------------ | ---------------- | ------------- |
| john          | + 1 (415) 691 9426 | 123 east street  | San Francisco |
| jack          | + 1 (415) 691 4595 | 213 north street | San Francisco |
| {% endtab %}  |                    |                  |               |
| {% endtabs %} |                    |                  |               |
