# Datasource Configuration

Starting from **ONEWEB version 4.0.0.19**, **App Designer** provides the ability to configure and manage **multiple Datasources**.\
Once a datasource is configured, entities can be set to use that datasource for querying table structures and data.

This feature adds flexibility by allowing Smart Forms to **connect to different databases** or data sources within the same application.

***

### Purpose of Datasource Configuration

Datasource Configuration is used to:

* Define multiple database connections in App Designer
* Allow entities to query data from different datasources
* Support integration with heterogeneous data environments
* Improve scalability and flexibility of Smart Forms
* Enable multi‑database or external data access scenarios

***

### Accessing Datasource Configuration

To manage Datasources:

1. Navigate to **DEV ZONE**
2. Open **App Designer**
3. Click the **Utilities** menu
4. Select **Datasource Configuration**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FWaaQixYSkSEbWSKm8S9i%2F0?alt=media" alt=""><figcaption></figcaption></figure>

***

### Viewing Existing Datasources

After opening Datasource Configuration:

* The system displays a list of **existing configured datasources**
* Each datasource represents a database connection available to App Designer

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FdcL6LxXONrhDMfXOXNUC%2F1?alt=media" alt=""><figcaption></figcaption></figure>

***

### Creating a New Datasource

To create a new datasource:

1. Click the **Add** icon ![](https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FYBzjsobPZKR0BKU4l1Wf%252F2%3Falt%3Dmedia\&width=300\&dpr=3\&quality=100\&sign=224d8aaa\&sv=2)
2. The **Datasource Configuration** screen opens
3. Enter the required datasource details (e.g. name, connection properties)
4. Click **Save**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FYXlxvx4xGlasJThDbxK9%2F3?alt=media" alt=""><figcaption></figcaption></figure>

Once saved, the new datasource becomes available for use in entities.

***

### Using a Datasource in an Entity

After configuring a datasource:

* Open the target **Entity**
* Go to **Entity Configuration**
* Set the newly created datasource as the **System Code**
* Save the entity

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FLDrEOMM5wnkKcXdSgK1y%2F4?alt=media" alt=""><figcaption></figcaption></figure>

Once configured, the entity will use the selected datasource to:

* Retrieve table metadata
* Query data during form operations

***

### Important Considerations

* Datasource Configuration affects how entities interact with databases
* Ensure datasource credentials and connectivity are correct
* Changing datasource for an existing entity may impact behavior
* Test entity functionality after switching datasources
* Restrict datasource management access to authorized users only

***

### Usage Guidelines

* Use separate datasources for different environments or systems
* Clearly name datasources to indicate purpose or target database
* Avoid frequent datasource changes on production entities
* Coordinate datasource configuration with database administrators
* Validate permissions and schema compatibility

***

### Summary

**Datasource Configuration** enhances App Designer by enabling **multi‑datasource Smart Forms**.

Key points:

* Available from ONEWEB version 4.0.0.19 onward
* Allows configuration of multiple database connections
* Entities can be bound to a selected datasource
* Improves flexibility and integration capabilities
* Essential for advanced data architecture scenarios

Used properly, Datasource Configuration allows ONEWEB applications to **scale across multiple data sources while maintaining clean and manageable entity designs**.


---

# 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/app-designer/utilities/datasource-configuration.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.
