# Connect to a Database

Manage your master and transactional data by connecting your existing databases to PowerTable. After establishing the connection, you can edit data, insert rows and columns, set up workflows, and write back changes directly to the connected database.

The following steps explain the process.

{% hint style="info" %}

#### Important

This feature is in preview.
{% endhint %}

### Prerequisites

Before you begin, make sure that you have the following prerequisites in place:

* Connections established to the [Fabric SQL database](/planning-sheets/how-tos/create-a-database-connection.md) and the [semantic model](/planning-sheets/how-tos/create-and-share-a-cloud-connection-for-a-semantic-model-sp.md) that contains the data for your PowerTable.
* A [Plan item](/planning-sheets/how-tos/creating-a-planning-sheet.md#create-a-planning-sheet) created in your Fabric workspace.

### Create a PowerTable sheet

1. In your Plan, select **New PowerTable Sheet** or select the **PowerTable** icon on the landing page. Enter a name for the sheet and select **Create**.

<figure><img src="https://2715773316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaNsuBB3HcAa0WUQhDTv%2Fuploads%2F7ry30irM89BmEVewcMmZ%2Fimage.png?alt=media&#x26;token=38a1911f-e4e5-4723-9835-f5eec70fc364" alt=""><figcaption></figcaption></figure>

2. Select **Create a New App** to create your app. You can also select **Explore PowerTable** to experience a sample PowerTable app.

<figure><img src="https://2715773316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaNsuBB3HcAa0WUQhDTv%2Fuploads%2FJ6ZWjCLrTegwQaYKCEFp%2Fimage.png?alt=media&#x26;token=fbb97371-2429-4a9d-bfc1-f460f641fe3d" alt="" width="563"><figcaption></figcaption></figure>

3. **Select a Connection:** Choose a Fabric SQL connection. You can also create a new connection if required.

<figure><img src="https://2715773316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaNsuBB3HcAa0WUQhDTv%2Fuploads%2FJnhupyc6gLgaYMLpc17x%2Fimage.png?alt=media&#x26;token=7e4eede7-8a50-4292-b723-50527e7aac42" alt="" width="375"><figcaption></figcaption></figure>

4. **Database Name:** Select the Fabric SQL database to store the app metadata. Select **Add**.

<figure><img src="https://2715773316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaNsuBB3HcAa0WUQhDTv%2Fuploads%2FSglk5FHRiYqJHV3cjdmX%2Fimage.png?alt=media&#x26;token=8fd922d0-2d89-4873-99b0-e5b278790fab" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

#### Note

When a new Plan item is created in a workspace, a Fabric SQL database is automatically created for that workspace. This database stores all the plan app metadata for workspace users. You can choose this database.
{% endhint %}

5. Select **Connect** after choosing the connection and the database.

<figure><img src="https://2715773316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXaNsuBB3HcAa0WUQhDTv%2Fuploads%2FnhZvSFiZ82SNpNG0wHkj%2Fimage.png?alt=media&#x26;token=284f5e7a-884b-4abb-b21b-fb19a0dd4063" alt="" width="563"><figcaption></figcaption></figure>

### Create a table

1. Select **Existing Table** to connect to an existing Fabric SQL database.
2. Choose the database schema and the table name to connect to.
3. Select **Next**.

<figure><img src="/files/rpDlUh4kRxoluppI5d3V" alt=""><figcaption></figcaption></figure>

4. PowerTable sheets automatically detect column properties. Review the table configuration. You can modify the input type and/or the primary key if required.&#x20;
5. Select **Finish.**

<figure><img src="/files/Tz4L6AXvv4tOJveyCszj" alt=""><figcaption></figcaption></figure>

You have now successfully connected to a database and created a table app using PowerTable. Click **Save** to save your table.

<figure><img src="/files/JZVt6awCqceEmUVQgztH" alt=""><figcaption></figcaption></figure>

### Next steps <a href="#next-steps" id="next-steps"></a>

Configure [access control](/powertable-sheets/how-tos/set-up-row-and-column-access-control.md) and automated workflows and [approvals](/powertable-sheets/how-tos/approval-flow/configure-approval-workflow.md) for your new app.


---

# 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.fabricplan.com/powertable-sheets/how-tos/connect-to-a-database.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.
