# Setting up a connection

Before you start saving data in your *Qommentary Form* extension, you will need to create or select an existing data connection.

*Qommentary Form* supports a range of file and database connections:

* XML
* JSON
* PostgreSQL
* MySQL
* SQL Server
* Oracle

### Creating file connections

File connections are the easiest and fastest way to get started writing data in your Qlik Sense applications. It requires no database setup and data is saved in a file format.

To create a new file connection, please follow these steps:

1\. Edit your sheet  \
2\. Expand the **Data connections » Data Source** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYc83mR6uEJK-LxbNLy%2F-MYdFxidsZ5ueu8vua6H%2Fimage.png?alt=media&#x26;token=f29d6a89-dee9-4f6e-8319-d1e5512f81d2" alt=""></div>

3\. Click on **Create a connection**\
4\. Select a file connection (i.e. XML, JSON)

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYc83mR6uEJK-LxbNLy%2F-MYdHQWf4M0Or4fuTeLT%2Fimage.png?alt=media\&token=5f9d2888-17f7-4a55-bfc5-c9046dd91c0f)

5\. Fill out required details

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYc83mR6uEJK-LxbNLy%2F-MYdJ2nEWbC8ryb7vOgS%2Fimage.png?alt=media\&token=7b766a7d-f179-47ee-a2e1-1acfe0e7951d)

6\. Optionally, you may click on **Test connection** to verify that the folder connection path is valid

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdM5Zvqp8NUrEqpY3S%2F-MYdN4nUIXPDfnpOtGN3%2Fimage.png?alt=media\&token=29a09937-1f7c-45ef-aeb1-1975ceaf74d1)

7\. Click on **Create** button

If the Folder connection path is valid, the connection will be successfully created and applied to your current extension.

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdKTk92b_UyaUCGxfn%2F-MYdLn4o1f7QuBEfPe7p%2Fimage.png?alt=media&#x26;token=44f8eb0a-d7f0-4e50-ab91-2c72fdbf3c5d" alt=""></div>

{% hint style="success" %}
Other file connections supported:

* JSON
  {% endhint %}

#### File connection properties

| Property name     | Description                                     | Default |
| ----------------- | ----------------------------------------------- | ------- |
| File name         | Name of your file (exc. extension name)         |         |
| Key column name   | Name of the primary key column                  |         |
| Enable audit logs | Enable to track and audit changes in your table | false   |

### Creating database connections

To create a new database connection, please follow these steps:

1\. Edit your sheet\
2\. Expand the **Data connections** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYc83mR6uEJK-LxbNLy%2F-MYdFxidsZ5ueu8vua6H%2Fimage.png?alt=media&#x26;token=f29d6a89-dee9-4f6e-8319-d1e5512f81d2" alt=""></div>

3\. Click on **Create a connection**\
4\. Select a database connection (i.e. PostgreSQL, MS SQL Server, etc)

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdM5Zvqp8NUrEqpY3S%2F-MYdMGXiwsWiMkVWMoX0%2Fimage.png?alt=media\&token=b36a7771-5ccf-422a-ae02-90e389ef545e)

5\. Fill out required details

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdM5Zvqp8NUrEqpY3S%2F-MYdNj_F2h8z75BA2MUv%2Fimage.png?alt=media\&token=dea4b278-76e6-4493-b010-9c654291a35c)

6\. Optionally, you may click on **Test connection** to verify that the database connection is valid\
7\. Click on **Create** button

If the database details are valid, the connection will be successfully created and applied to your current extension.

{% hint style="success" %}
Other database connections supported:

* PostgreSQL
* MySQL
* Oracle
  {% endhint %}

### Selecting an existing connection

When you add a Qommentary Writeback extension to your application, you can choose to create a new connection or select from an existing one.&#x20;

To select from an existing connection, please follow these steps:

1\. Edit your sheet  \
2\. Expand the **Data connections » Data Source** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYc83mR6uEJK-LxbNLy%2F-MYdFxidsZ5ueu8vua6H%2Fimage.png?alt=media&#x26;token=f29d6a89-dee9-4f6e-8319-d1e5512f81d2" alt=""></div>

3\. Click on **Select existing connection** button\
4\. Pick a connection from the list

![](https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdPvCOv8oeG03DP9we%2F-MYdWD9IKitt-FW9GJR5%2Fimage.png?alt=media\&token=73788ab5-d74b-4286-9ad5-b96a65d4e6e7)

5\. Click on **Select** button

The selected connection is successfully applied to your current extension:

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdWNBZWQgw8LX-txIw%2F-MYeWBS76HnpsKtY-4rP%2Fimage.png?alt=media&#x26;token=4bb40e26-17d4-40ef-90fc-2d6d70d7151f" alt=""></div>

### Removing a connection

If you wish to disassociate a currently selected connection from your extension, you may remove it following these steps:

1\. Edit your sheet\
2\. Expand the **Data connections » Data Source** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdWNBZWQgw8LX-txIw%2F-MYeWBS76HnpsKtY-4rP%2Fimage.png?alt=media&#x26;token=4bb40e26-17d4-40ef-90fc-2d6d70d7151f" alt=""></div>

3\. Click on the "x" button

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYeWT1kjHPe9gMuHz2j%2F-MYeZ6HowN67w3E0ijfb%2Fimage.png?alt=media&#x26;token=dd9d408c-c9a0-49be-a326-157c69d71b37" alt=""></div>

The connection is removed successfully.

{% hint style="info" %}
You'll need to select a data connection before data can be saved.
{% endhint %}

### Editing a connection

To edit a data connection, please follow these steps:

1\. Edit your sheet\
2\. Expand the **Data connections » Data Source** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdKTk92b_UyaUCGxfn%2F-MYdLn4o1f7QuBEfPe7p%2Fimage.png?alt=media&#x26;token=44f8eb0a-d7f0-4e50-ab91-2c72fdbf3c5d" alt=""></div>

3\. Click on the pencil icon

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYeZhqN52Pnjpksmqps%2F-MYeaPfYvptsNiLvALFp%2Fimage.png?alt=media&#x26;token=99e30e51-36f6-4643-bcf3-70be4f295bee" alt=""></div>

4\. Update details accordingly\
5\. Click on *Save* button

The connection is updated successfully.

### Deleting a connection

To delete a data connection, please follow these steps:

1\. Edit your sheet\
2\. Expand the **Data connections » Data Source** section

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYdWNBZWQgw8LX-txIw%2F-MYeWBS76HnpsKtY-4rP%2Fimage.png?alt=media&#x26;token=4bb40e26-17d4-40ef-90fc-2d6d70d7151f" alt=""></div>

3\. Click on the trash icon

<div align="left"><img src="https://3028830514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M43RhGzV8Plu0tfknia%2F-MYeZhqN52Pnjpksmqps%2F-MYeajrZm2KcaW62SZhr%2Fimage.png?alt=media&#x26;token=4ea6dd17-6582-444d-b05b-c8a939ded367" alt=""></div>

4\. Once a confirmation message is displayed, click on **Confirm** button

The connection is deleted successfully.

{% hint style="danger" %}
This operation will permanently delete the connection from the system. &#x20;

Any other instances of Qommentary Form currently using this connection will not be able to save data until a new connection is selected.
{% endhint %}
