# 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](https://1117313960-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fcloudio-new-documentation%2F-M2HHy_Ft5bm5camEmi7%2F-M2HJVW6G8yl3H4otnVL%2F0.png?generation=1584076557118048\&alt=media). The navigation pane is displayed.

![](https://1117313960-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fcloudio-new-documentation%2F-M2HHy_Ft5bm5camEmi7%2F-M2HJVW7gV7P8TiFT7q0%2F1.png?generation=1584076557162290\&alt=media)

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

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

![](https://1117313960-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fcloudio-new-documentation%2F-M2HHy_Ft5bm5camEmi7%2F-M2HJVW8O5F25jbBrgWB%2F2.png?generation=1584076557141776\&alt=media)

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

The **Generate Datasource** window is displayed.

![](https://1117313960-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fcloudio-new-documentation%2F-M2HHy_Ft5bm5camEmi7%2F-M2HJVW9Gq7NwI8Tpd3W%2F3.png?generation=1584076557143373\&alt=media)

&#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](https://docs.cloudio.io/creating-datasources/working-with-datasources/managing-datasources) page.
