# Using a Data Table

#### Step 1: Add a Data Table

In Edit Mode, click the **Add** button in the top-right corner. From the dropdown menu, select **Data Table**.

<figure><img src="/files/ZxiuGRnVrMk1DSa8d3jV" alt=""><figcaption></figcaption></figure>

#### Step 2: Configure the Table

In the **Create Data Table** panel, give your table a name and set the number of rows and columns you need. Then click **Create Table**.

<figure><img src="/files/sWWTyXVuq8CJwbZZFADd" alt=""><figcaption></figcaption></figure>

#### Step 3: Enter data or select a cell to link

Your new empty table will appear on the dashboard. You can type static values directly into any cell, or select a cell to link it to a live data source.

<figure><img src="/files/g28iwxqI5KbOoYMPcQIu" alt=""><figcaption></figcaption></figure>

To link a cell to live data, click the cell you want to populate (e.g. **B3**) and then click the **link icon** in the cell toolbar.

<figure><img src="/files/yLkBs3n9Ty7NQSSIXWqK" alt=""><figcaption></figcaption></figure>

#### Step 4: Configure the Custom Block

The **Create Custom Block** panel will open on the right. Here you can:

* Choose your **Data Source Type** (e.g. Google Analytics 4)
* Give the custom block a **name** — this becomes a project datablock
* Select your **Database Connection**

Then click **Configure** to set up the query.

<figure><img src="/files/2UnevJgf2sTC9aTgAFf3" alt=""><figcaption></figcaption></figure>

#### Step 5: Set Metrics, Dimensions & Filters

Under the **Configuration** section, set your desired **Date Range**, then scroll down to choose your **Metrics** (e.g. Active Users) and optionally add **Dimensions**, **Metric Filters**, **Dimension Filters**, and **Order By** settings.

<figure><img src="/files/br6Uqw5atBEqp35P1NTD" alt=""><figcaption></figcaption></figure>

When ready, click **Preview Data**.

#### Step 6: Preview and select your primary metric

After previewing, you'll see a **Data Preview** showing the results. Choose how to aggregate the data — either **Total** (sum all numeric values) or **Average** — then select the **primary metric** to display in the cell from the dropdown.

Click **Create Custom Block** to confirm.

<figure><img src="/files/4VJRu7hfUFhqdEOWiRP2" alt=""><figcaption></figcaption></figure>

#### Step 7: Save your dashboard

Your cell will now display live data pulled from your connected data source. The status bar at the bottom of the table will show **Ready** and indicate which datablock the cell is linked to. Click **Save** in the top-right to save your changes.

<figure><img src="/files/Ajr1BWtH2dnta7e8fdiX" alt=""><figcaption></figcaption></figure>


---

# 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.smaq.io/documentation/features/dashboard/using-a-data-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.
