# Configuration

### 1. Setup

{% hint style="warning" %}
When setting up the Komment object ensure that you do **not** have the data load editor open in a separate browser tab.
{% endhint %}

#### 1.1 Base settings:

![Setup screen](/files/73KRbzvLetISAjMyOhir)

`Mode`: Default mode is **Table**. Select **Form** or **Popup** if desired.

`Fact Table Name`: Select the table from your data model on which you want to relate your write-back to.

`Custom Date Format:`Only applicable when using Kaptain as Data connection. [Go to section](/komment/optional-settings/dataconnection.md#date-settings).

`Date Format:` Select the date format you wish to have your date selector values shown in.

`Ignore Timezone:` Only applicable when using Kaptain as Data connection. [Go to section](/komment/optional-settings/dataconnection.md#date-settings).

`Server Timezone:` Only applicable when using Kaptain as Data connection. [Go to section](/komment/optional-settings/dataconnection.md#date-settings).

`Writeback Variable Name:` Ensure to name unique if you have multiple Komment objects in your app.

`Writeback Table Name:` The name of the QVDs that are stored. Ensure to name unique if you have multiple Komment objects in your app or different apps are storing QVDs to the same location.

{% hint style="info" %}
If you wish to store your QVDs in a subfolder to a given data connection you can change this in the load script later. This is recommended if you have multiple apps which uses Komment.
{% endhint %}

#### 1.2 Data Connection Settings:

![Define Transports](/files/cJpDQJ2NagCdRZK9g9xE)

`Connection Type:` Select between QIX Engine or Kaptain

`QVD Data Connection:` Select the data connection where you want to store your QVDs

`QVD Storage:` This defines whether your data is stored into one QVD or separate QVDs.

If you have selected Kaptain as your Data Connection you must be on the Standard plan or higher and have the Kaptain service installed. To configure your Kaptain setup go to this [section](/komment/optional-settings/dataconnection.md).

### 2. Widgets

In this section you simply define which fields you want to make it possible to edit and how they should be editable. You can see a full description of each widget type in the Widget section under Features.

{% content-ref url="/pages/-M3GyBlyMMCY4SRKJ325" %}
[Widgets](/komment/features/widgets.md)
{% endcontent-ref %}

#### 2.1 Add widgets

![Add new widget](/files/-M3H2L9X80h7JOB6I4JF)

#### 2.2 Define widgets

![Define widgets](/files/-MBrL4fTVjGMSdrqMolm)

`Widget Type:` Select your Widget type.

`Mode:` Choose between Field or Expression

`Qlik Field Name:` Select the relevant field name from the defined Fact Table.

`Komment Key Field:` If your selected field is the association between your data model and write-back data then check this field.

`Widget Label:` Define the label for the widget. If nothing is entered the Field Name will be displayed.

Continue this for all the widgets you want to add.

{% hint style="warning" %}
We recommend to place the widget holding the Komment Key Field as the first widget
{% endhint %}

### 3. Finalize configuration

#### 3.1 Preview Load Script

Go back to Setup => Press `Preview Load Script`

![Preview Load Script](/files/-MBrM6bsNs9QJqOMRu5H)

#### 3.2 Initialize Data Model

You will now be presented with the auto-generated Komment load script as shown below. &#x20;

![Initialize Data Model](/files/-M3H5FGX0iW7Zt91h_7j)

Now press `Initialize Data Model`. Komment will now automatically inject the script in your Data Load Editor and do a reload of the application.

{% hint style="success" %}
That's it! You have now successfully configured your write-back solution.
{% endhint %}

{% hint style="info" %}
Qlik Engine has a known issue that can occur when initializing the data model. This error warning can safely be ignored as the data model will be initialized correct.

<img src="/files/-M3QKQ1KaYQAbqqZf2OM" alt="" data-size="original">&#x20;
{% endhint %}

#### 3.3 External script

If you want to externalize the Komment script section and use variable based path, you must ensure that the variable is not cleared out after must\_include/include function:

```typescript
//Set script path
LET vScriptPath = ‘lib://myScriptFolder’;

//Include komment logic in qvs file
$(Must_Include=[$(vScriptPath)/Writebacks/Komment.qvs]);

//Clean variables
LET vScriptPath = ‘’;
```

In above case, Qlik will run into an error when reloading. That’s because Qlik will firstly execute the ‘Clean variables’ part rather than ‘Include’ function. So the suggestion is to either move the clean logic into a qvs with include or remove it if not necessary.


---

# 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.extendbi.com/komment/getting-started/configuration.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.
