# GETSTATEMENT

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

**GETSTATEMENT**(*widget*)

1. *widget* - a reference to the widget from which the current statement should be returned - ***Value type**: widget reference (optional; default: current widget)*

#### Remarks

* Returns a string containing the statement which is created by nedyx based on the current settings in the Connection tab. So the same statement which is sent to the database if GETDATA is called without parameters. Depending on the connection type, the statement is
  * SQL for ODBC connection type
  * MDX for Analysis Services (SSAS) connection type
  * REST URI for OData or Google Sheets connection type

#### Example

The cell at the bottom is filled with the SELECT statement which has been auto-generated for the table on the top.

<figure><img src="/files/voF4UxIB5NQuoC40ffiK" 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.nedyx.com/nedyx/clearlines-functions/database-functions/getstatement.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.
