# Buttons

**There are two buttons setup by default in the Komment object:**

**`Submit:`** Used to commit user inputs and trigger a saving action.

**`Clear:`** Used to clear the input in the current user has entered but not saved yet.

**You have the option to add three additional buttons:**

**`Add:`**&#x54;his will enable users to add new records to the data using Komment

**`Remove:`** This will enable users to remove records from the Komment table

**`Reset:`** This will reset the content of all widgets for the chosen record. i.e. as if no data had ever been entered into any of the widgets. This functionality is available in **Form** and **Popup** modes.

Below is a small GIF showing how Reset and Clear buttons work:

![Reset and Clear buttons](/files/-MSmZHAg9CAIXGT9dUTG)

## Settings

You find the button settings in the Button Settings section:

![Button settings](/files/-M3Q9S0wnkWPFYQSvh6B)

`Label`: Provide your own label to be displayed to end users

`Button Type`: Select `Submit` , `Clear` , `Add` , `Remove` or `Reset`

`Do Partial Reload:` Toggle Yes/No (default is Yes)

`Confirm before Reload:` Toggle Yes/No (default is No). Activates a dialogue when pressing submit.

`Confirmation header:` Define the header of the dialogue shown to end user.

`Confirmation message:` Define the message of the dialogue shown to end user.

## Add/Remove

### Add

When you have defined the `Add` button in the setup it is very easy for users to add new records to the data:

![Add new records](/files/-MBruExhEP5Km-XTQVJ1)

Behind the scenes Komment will generate a new record with an auto-generated ID. If you wish to let the user decide on an ID to add and show but still keep a unique ID saved each time you can use the below method:

**1. Load script:**

* Add a new ID field to your Fact table

<div align="left"><img src="/files/-MBryUg02XKMsHJxqiE8" alt=""></div>

2\. In the Komment object:

* Include both ID fields as widgets

![Add two ID fields](/files/-MBrzFy7lo55x3bngswm)

* Hide the original ID field

![Hide ID field](/files/-MBrz_3wNAIpy35EbBdd)

* The newly created ID field 'DriverID' should be shown

![Show DriverID](/files/-MBrznfhzatPxtl_puK3)

* The Add form will then show the DriverID and not the original ID

![Add form only shows one ID](/files/-MBrzzqEhJME3tD9iYMu)

* After adding a record the Komment table and related audit trail will look like this:

![Table and audit trail after addition of new record (DriverID = 0)](/files/-MBs-GYUfzlDaFb46GOT)

### Remove

Depending on which Mode you have Komment set to, there are different ways of how to use the `Remove` button.

`Table Mode:` Here you enable the remove functionality by pressing `Batch Edit` => Select the records you want to remove => press `Edit` => press `Remove`

![Remove in Table mode](/files/-MBufCicB-bgwEAvsxtG)

`Form Mode:` In Form mode the remove button is directly visible to the user.

![Remove in Form Mode](/files/-MBufaNL3SgrCz1YSfrG)

Popup Mode: In Popup mode the remove action can be performed directly by pressing the trash can icon on the button.

![Remove in Popup Mode](/files/-MBug0Bxs_ZNZT5a_aKv)

### State

When removing records the records are not actually deleted. Instead Komment handle the status of each record by introducing a `_state`field. The `_state` field can take three values:

* modified
* removed
* new

This field is saved with each data entry or record removal and is available in the stored Komment table along with the `CreatedBy` and `CreatedAt` fields.


---

# 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/optional-settings/buttons.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.
