# How to Use Data Viewer

This section explains how to use **Data Viewer** to connect to a database, browse data, and execute queries directly from **AppSpace**, without using external database tools.

***

### Open Data Viewer

1. Open the application in **AppSpace**
2. Select the **Database** menu
3. Under **Tools**, click **Data Viewer**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F4GVggEcCWnJUpY72Kc0O%2Fimage.png?alt=media&#x26;token=fc384227-dd38-4f8d-bf45-8f28ac04b833" alt=""><figcaption></figcaption></figure>

The system opens the **Data Viewer** screen.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FnuBQSyUpQYLo0gIMFcko%2Fimage.png?alt=media&#x26;token=df9fca36-4557-42c9-8a69-5b4c88946ab8" alt=""><figcaption></figcaption></figure>

***

### Data Viewer Interface Overview

The Data Viewer UI consists of two main sections:

* **Sidebar**\
  Used to search, filter, and browse database connections, schemas, and tables.
* **Toolbar**\
  Contains controls to interact with data, run queries, and open additional tools.

***

### Create a New Database Connection

To create a new database connection:

1. In the **Sidebar**, click the **New Connection** icon

<div align="left"><figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FSNUvsIlOn4sP9WObyzOF%2Fimage.png?alt=media&#x26;token=a4bf89b4-d2cb-4231-9b4b-201cfb8d182e" alt=""><figcaption></figcaption></figure></div>

2. The **Create Connection Wizard** opens
3. Follow the steps below:

#### Step 1: Enter Database Details

Provide details such as host, port, database name, and credentials.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FDMlXEJeKQwXx9uW0L7FR%2Fimage.png?alt=media&#x26;token=336c4e7b-d96f-436d-9026-994bced6f88a" alt=""><figcaption></figcaption></figure>

***

#### Step 2: Configure Database Driver

* Select an existing database driver, or
* Upload a new driver version if required

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FolQztpJD0zBFZtQdMhXw%2Fimage.png?alt=media&#x26;token=1cfd5001-8d5d-4ba5-8670-bf4ff11cd129" alt=""><figcaption></figcaption></figure>

***

#### Step 3: Test and Save the Connection

1. Click **Test** to verify connectivity
2. If the test is successful, click **Save & Done**

The new connection appears in the list of available connections.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FE0BMCtfVFjIAImi1LXYP%2Fimage.png?alt=media&#x26;token=d314ca37-d1a9-426f-a86f-20beda7adc7a" alt=""><figcaption></figcaption></figure>

***

### Browse Tables and View Data

1. Expand a **Database Connection** in the Sidebar
2. Expand the schema to view tables
3. Double‑click a table to fetch and display its data

<https://2015371994-files.gitbook.io/\\~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fbj6Jt6FsB0wWUNerGWfr%2Fimage.png?alt=media\\&token=f8932fcb-bc6a-45df-b51b-8789b4ed4d84>

***

#### 🔍 Search, Filter, and Sort Records

* Use the **search field** to filter records
* Click column headers to sort data in ascending or descending order

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FPUIvC4fkeMevgnS6INzi%2Fimage.png?alt=media&#x26;token=a16d4c43-c004-40c7-9e24-0b32c30d8a2a" alt=""><figcaption></figcaption></figure>

***

#### Identity Key Configuration

The **key icon** allows users to set **identity (primary key) columns**, which enables saving edits back to the database.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F75QLfaZjNQJ5GiK78H1N%2Fimage.png?alt=media&#x26;token=5b0a96fb-5c3a-4f95-badb-8186416b8757" alt=""><figcaption></figcaption></figure>

***

### Record Count Information

At the bottom of the data panel, Data Viewer displays:

* Total number of records retrieved
* Number of fetch operations performed

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FVWbRnmwiI1IWyXkoWVGl%2Fimage.png?alt=media&#x26;token=be466a55-4bad-42e8-8b19-50893919b548" alt=""><figcaption></figcaption></figure>

***

### Generate SQL Statements from Data

Data Viewer allows users to generate basic SQL statements directly from table data, including:

* **INSERT**
* **UPDATE**
* **DELETE**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FzdVMHDuiq8EZpJMgrG11%2Fimage.png?alt=media&#x26;token=d657c439-bb02-4536-85b8-b2a5f426cf4c" alt=""><figcaption></figcaption></figure>

***

### Run Custom SQL Queries

#### Open Script Window

1. Click the **Script** icon on the toolbar

<div align="left"><figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FzJqvyGyuFP2KZsfUDlec%2Fimage.png?alt=media&#x26;token=326d2e56-583e-4e31-96bc-633b622505c4" alt=""><figcaption></figcaption></figure></div>

***

#### Select Connection and Execute Query

1. Click the **Connection** icon and choose a database connection
2. Once connected (icon turns green), click **Run** to execute the SQL

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FglOQunqDVWblHer4cO56%2Fimage.png?alt=media&#x26;token=ec52ffb4-f4fc-400e-af8b-89cc3df8d43c" alt=""><figcaption></figcaption></figure>

***

### Summary

**Data Viewer** enables users to explore and validate database content directly within ONEWEB.

Using Data Viewer, users can:

* Create and manage database connections
* Browse schemas and tables
* Search, sort, and filter table data
* Generate SQL statements
* Execute custom SQL queries

This makes Data Viewer a powerful and convenient **database visualization and validation tool** within ONEWEB’s **Database Tools** suite.


---

# 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.onewebstack.com/designer-reference/data-designer/data-viewer/how-to-use-data-viewer.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.
