# Extract a Subtable from the Table

### Overview

This procedure helps you create a new table from an existing one by choosing which columns and rows to keep or remove. You can include or exclude specific columns and filter rows using selection formulas.

### Input Concepts

| Concept                          | Type            | Description                                                    | Default    | Required |
| -------------------------------- | --------------- | -------------------------------------------------------------- | ---------- | -------- |
| `table`                          | table           | The original table from which the new table will be extracted. | No default | Yes      |
| `included columns`               | list of strings | Columns to include in the new table.                           | All        | No       |
| `excluded columns`               | list of strings | Columns to exclude from the new table.                         | None       | No       |
| `included row selection formula` | string          | Formula to select rows to include.                             | -          | No       |
| `excluded row selection formula` | string          | Formula to select rows to exclude.                             | -          | No       |

### Output Concepts

| Concept | Description         |
| ------- | ------------------- |
| `table` | The extracted table |

### Examples

For the example below, consider the following `table`:

| Name   | Color  | Taste |
| ------ | ------ | ----- |
| Apple  | Red    | Sweet |
| Banana | Yellow | Sweet |
| Lemon  | Yellow | Sour  |

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

```
extract a subtable from the table where
    the included columns are "Name", "Color"
```

{% endtab %}

{% tab title="Results" %}

| Name          | Color  |
| ------------- | ------ |
| Apple         | Red    |
| Banana        | Yellow |
| Lemon         | Yellow |
| {% endtab %}  |        |
| {% endtabs %} |        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/automation-areas/tables-v2/query-a-table/extract-a-subtable-from-the-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
