> For the complete documentation index, see [llms.txt](https://docs.powertable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.powertable.com/explore-powertable/create-table-app/connect-to-database.md).

# Connect to Database

In the previous section, we demonstrated the steps to [build your first app by importing your CSV data](/explore-powertable/powertable-product-tour/build-your-first-app.md).&#x20;

In this section, we'll connect to your existing database and create an app using PowerTable.

**The source and destination will be the same**, so we will connect to and writeback the changes to the same database. Let us look at the steps.

1. Go to your Microsoft Fabric workspace folder. Click on **New item** to create a new item.

<figure><img src="/files/0LxBWh6RhPCfoSjX2kCC" alt=""><figcaption><p>Create a new item</p></figcaption></figure>

2. Select **PowerTable** from the list of items. You may want to add it to your favorites by clicking on the star icon.

<figure><img src="/files/jOXD5EoMZjGyVZce9bvw" alt=""><figcaption><p>Select 'PowerTable'</p></figcaption></figure>

3. Enter a name for your PowerTable app and select the workspace. Click on **Create.**

<figure><img src="/files/040JuFDhCZRzsyYIprCW" alt=""><figcaption><p>Create PowerTable item</p></figcaption></figure>

4. Click on **Create a New App** to create your app. You may also select 'Explore PowerTable' to [experience a sample PowerTable app](/explore-powertable/powertable-product-tour/explore-a-sample-app.md).

<figure><img src="/files/1d7UdiZsoxcGwHkhiKIa" alt=""><figcaption><p>Create a New App</p></figcaption></figure>

5. **Choose your data source:** The next step is to select an existing database to connect to. After connecting to it through PowerTable, your app synchronizes its data with the database.&#x20;

Let's say you want to connect to sales data residing in a Microsoft Fabric SQL database. Follow the steps below to create a new connection to your preferred data store:

* Click on **New Connection.**
* Choose your preferred data platform. We'll connect to the Fabric SQL database.
* Click **Next.**

<figure><img src="/files/HP0jlhiStBytQT1gBKXN" alt=""><figcaption><p>Creating a new connection</p></figcaption></figure>

{% hint style="info" %}
If you already have shared database connections or a private connection to the required data store, skip step 5. Instead, click on the 'Existing Connection' tab, select the one you want to use, and then click **Next.**
{% endhint %}

<figure><img src="/files/MqJbCiAhFJnEerU2nxdn" alt=""><figcaption><p>Choosing an existing connection</p></figcaption></figure>

6. **Setup Connection:** Enter the connection type and a unique connection name. Select the workspace and the database from the list of options and click **Next.** Your new private connection is now created.

<figure><img src="/files/el0zZ02Kj3leAHb1XLCz" alt=""><figcaption><p>Setup Connection</p></figcaption></figure>

7. **Choose your table:** In this step, you have two options :

   1. Select **Existing Table** to connect to an existing table in the database (or)
   2. Select **New Table** to create a new table in the database.

   Since we want to connect to an existing database, we'll choose **Existing Table.** We'll enter the schema name and the table name 'Sales' to connect to it. Click **Next.**

<figure><img src="/files/UuGFgqaF1fcMez7cFYRa" alt=""><figcaption><p>Connecting to database</p></figcaption></figure>

8. PowerTable detects column properties automatically. You can edit them if necessary. Select the primary key. After verifying the details, click **Finish.**

<figure><img src="/files/lWKZ6HFLcOjlUjLIkYvh" alt=""><figcaption><p>Click 'Finish'</p></figcaption></figure>

You have now successfully connected to a database and created an app using PowerTable.

<figure><img src="/files/kom4piaXj6Rb6a6ajzjx" alt=""><figcaption><p>PowerTable app created</p></figcaption></figure>

You can start working with this data, making changes as needed and configuring access control, workflows, approvals, and other features for your new app. These are covered in the upcoming sections.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.powertable.com/explore-powertable/create-table-app/connect-to-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
