# Generating a data source

A quick way for creating a data source is by auto-generating it from a database table or a view. Here, we don't provide the table name while generating the data source. Instead, we fetch the required data by defining pre-queries and post queries.

1. In the top right corner of the menu bar, click ![C:\Users\user\Dropbox\Preeti\_ibruk\CloudIO\Deliverables\Icons\NavigationMenu.png](/files/-M2HJVW6G8yl3H4otnVL). The navigation pane is displayed.

![](/files/-M2HJVW7gV7P8TiFT7q0)

&#x20;2\. Under the required role group, click **Manage Datasources**.

The **Manage DataSources** page with the list of datasources is displayed.

![](/files/-M2HJVW8O5F25jbBrgWB)

&#x20;3\. In the upper right corner of the **Manage Datasources** page, click **Generate Datasource**.

The **Generate Datasource** window is displayed.

![](/files/-M2HJVW9Gq7NwI8Tpd3W)

&#x20;4\. In **SQL Query or Table Name,** enter the API name without the environment URL or paste the data in JSON format.

Sample JSON:

```
{
 "Employee": {
 "FirstName": "Sriaknth",
 "LastName": "A"
 }
}
```

{% hint style="warning" %}
Note&#x20;

This field must be left **blank** if the data source is being generated using a **database object**.

Enter the value in this field only if the data source is being generated using a **live connector**.
{% endhint %}

&#x20;5\. Define the datasource details:

| **Datasource detail**                                                                                                                      | **Description**                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Datasource Name                                                                                                                            | <p>A unique name for the datasource</p><p><em><strong>Note</strong>: The datasource name field does not accept any spaces and special characters.</em></p>                                                                                                                                                                                              |
| Assign To Role                                                                                                                             | The role to which the datasource is to be assigned                                                                                                                                                                                                                                                                                                      |
| Params                                                                                                                                     | ***Note**: Do not enter any value here.*                                                                                                                                                                                                                                                                                                                |
| Object Connection Code                                                                                                                     | <p>A connection code for connecting to different schemas/databases.</p><p><em><strong>Note:</strong> The object connection details of these schemas/databases must be defined in the <strong>Setup</strong> page. If you are using the default application schema under the current subdomain, you must not select any Object Connection Code.</em></p> |
| <p>Access permission checkboxes:</p><ul><li>Insert<br>Allowed</li><li>Update Allowed</li><li>Query Allowed</li><li>Audit Allowed</li></ul> | Indicate the access privileges to the role                                                                                                                                                                                                                                                                                                              |

&#x20;6\. Click **Generate**.

The datasource is generated. You can further edit and define details from the [Manage Datasources](/creating-datasources/working-with-datasources/managing-datasources.md) page.


---

# 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.cloudio.io/creating-datasources/working-with-datasources/generating-a-data-source.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.
