# GETDATA

#### Syntax <a href="#syntax.22" id="syntax.22"></a>

**GETDATA**(*statement*)

* *statement* - the statement which is sent to the database to retrieve the data - ***Value type**: text (optional)*

#### Remarks <a href="#remarks.19" id="remarks.19"></a>

* This function can only be executed by a widget which has a database connection assigned (a button, menu or a table widget), either directly in its Connection tab, or by a reference to another widget (see chapter [Connection property](/nedyx/clearlines-functions/general-aspects/calculated-widget-properties/connection.md)).
* If GETDATA is called without a parameter, the function returns the content of the database table which is defined in the Connection tab.

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

* If GETDATA is called with the parameter *statement*, the string defined by statement is sent to the database instead of the settings in the Connection tab.

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

* If GETDATA is called for a hierarchy or a hierarchy menu widget, it returns the data in a hierarchical structure:

<figure><img src="/files/CHEc1sQJlK5b8qz99rBa" alt=""><figcaption><p>The left selected widget is a hierarchy widget, the right widget a table widget. Depending on the widget type, the GETDATA function returns the content in a hierarchical structure.</p></figcaption></figure>

For these widget types, the property "Number of levels" in the Connection tab specifies how many of the first columns define the hierarchy:

<div align="left"><figure><img src="/files/PHGqI6ljxBtTsiEcUze5" alt=""><figcaption></figcaption></figure></div>


---

# 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.nedyx.com/nedyx/clearlines-functions/database-functions/getdata.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.
