# Builder

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

The **Builder** is Gaio DataOS’s visual query builder.\
It allows both technical and non-technical users to construct structured queries in a simple and intuitive way — without writing SQL code (though the generated SQL can be viewed and edited at any time).

***

## &#x20;How to Use the Builder

***

### **1. Insert and Select a Table Block**

* Add a **Table** to your flow and choose the dataset you want to work with.
* The Builder task will only become available once a table is selected.

### **2. Open the Builder Task**

* In the left-hand menu, go to: **Tasks > ETL > Builder**
* On the left panel, all available fields will be listed below, with icons indicating data types (text, number, date, etc.).

### **3. Configure Basic Info**

* **Task label**: (optional) Add a name for the task to identify it in your flow.
* **Table**: The table should be automatically linked from your selected block (e.g., `new_sales`).

***

### 4. **Build Your Query Visually**

Inside the **Builder** tab, you can construct your query using the following blocks:

**Columns:** Choose the fields you want to display in the results and apply aggregate functions like `SUM`, `COUNT`, `AVG`, etc.

**Filter:** Apply conditions to narrow down the dataset (e.g., `region = 'South'`, `units_sold > 5`).

**Join:** Link other tables using relationships (JOINs).

**Group:** Group the data by one or more columns.

**Filter After Grouping:** Filter the grouped results (e.g., show only products with total sales above 100 units).

**Order:** Sort the result set based on selected fields.

**Rows & Page (Offset):**&#x20;

* **Limit**: Max number of rows to return.
* **Offset**: Number of rows to skip (useful for pagination).

***

### 5. **Use Query Features**

In addition to the **Table** tab, you’ll find two options at the top left:

**Computed:** Create **calculated fields** using custom expressions.\
Example: `units_sold * unit_price` to generate a total sales field.

{% hint style="warning" %}
To use parameters in calculated fields, the user must enter **‘{{parameter\_name}}’** in their function or as a value.
{% endhint %}

**Aggregated:** Manage and view all **aggregated fields.**

***

### 6. **View the Output and Logic**

At the top of the screen, you’ll find two useful tabs:

**SQL:** Displays the **SQL code automatically generated** based on your configuration. You can review, copy, or even edit it as needed.

**Preview:** Shows a **real-time preview of the query results**, helping you validate the logic before saving.

***

### 7. **Run or Save the Query**

* Click **Save** to store your query configuration.
* Click **Save and run** to immediately execute the query and preview the results.

***

#### Best Practices

* Use **Computed** fields to create metrics directly in your query.
* Always review the **SQL** tab to understand what’s being executed.
* Use **Preview** to validate the output before saving or publishing.
* Name your queries clearly to keep your project organized.


---

# 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.gaiodataos.com/tools/tasks/etl/builder.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.
