# Data Table Attach Form

{% hint style="info" %}
**Block Information**

Available in: Page Flow

Toolbox Category: Widget - Data Table

Block Type: [Regular](https://docs.zingy.ai/app-editor/block-anatomy#regular-block)
{% endhint %}

The [Data Table](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-table) widget uses a default generic form for adding or editing records to the attached [Database Table](https://docs.zingy.ai/app-editor/data/database-tables).

The **`Data Table Attach Form`** block allows you to use your own form for adding and/or editing records.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F4ms0hZwmxcKCRPtTdGfJ%2Fimage.png?alt=media&#x26;token=acccdc4e-6eb8-4f2d-82ab-1cf71891a4a6" alt="" width="296"><figcaption><p>Data Table Attach Form block</p></figcaption></figure></div>

The block consists of the following (from top to bottom):

* *Data Table*: [Selectable Input](https://docs.zingy.ai/app-editor/block-anatomy#selectable-input) to choose the [Data Table](https://docs.zingy.ai/app-editor/page-editor/built-in-elements/data-table) widget from your page.
* *Usage*: [Dropdown configuration setting](https://docs.zingy.ai/app-editor/block-anatomy#dropdown) for choosing when your custom form needs to be used:
  1. New and Edit: Use the form for both adding and editing records.
  2. New: Use the form only for adding records.
  3. Edit: Use the form only for editing records.
* *Form Slug*: [Input](https://docs.zingy.ai/app-editor/block-anatomy#input) configuration setting to specify the [URL slug](https://docs.zingy.ai/page-settings#page-url) of the form to be shown.
* *Title*: [Input](https://docs.zingy.ai/app-editor/block-anatomy#input) configuration setting to specify the title to use.

{% hint style="success" %}
NOTE: To use a different form for adding and editing records, use this block twice, specify the appropriate form, and select the *Usage* configuration setting.
{% endhint %}

***

## Usage Example

The image below shows an example of the Data Table Attach Form block where the *EmployeeForm* is used for both adding and editing records.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FaQDqLajeDNzTdUjVeH10%2Fimage.png?alt=media&#x26;token=d6f9f8fe-178c-4dea-b187-e9c98522d4f9" alt="" width="556"><figcaption><p>Example of Data Table Attach Form block</p></figcaption></figure></div>
