# Data Add Record

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

Available in: Page Flow and Cloud Flow

Toolbox Category: Data - Edit

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

**`Data Add Record`** is a [regular block](https://docs.zingy.ai/app-editor/block-anatomy#regular-block) that initiates the addition of a [record](https://docs.zingy.ai/data/database-tables#table-records) into a [database table](https://docs.zingy.ai/app-editor/data/database-tables).

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FKOH9tZbWrZ2bp6jNZ4lQ%2Fimage.png?alt=media&#x26;token=cbfcf1cd-92d0-4091-a1ba-1a3c5aafbf68" alt="" width="212"><figcaption><p>Data Add Record block</p></figcaption></figure></div>

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

* *Table:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the name of the [Database Table](https://docs.zingy.ai/app-editor/data/database-tables) .
* *Dataset Name:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the name of the dataset. This can be any [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value and can later be used to track the completion.
* *Dataset Refresh*: [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [boolean](https://docs.zingy.ai/app-editor/page-flow/references/value-types) (true/false) value to indicate if you want the system to refresh the records in the same dataset after successful completion.
* *Record Data*: [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts an [object](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the record to be added. The Object block is pre-attached by default and its properties are automatically populated based on the fields of the selected table.

{% hint style="success" %}
**NOTE**: This block initiates the database record addition, which will occur in the background. To track the status and to take an action upon completion, use the [Data Status](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-status) block.&#x20;
{% endhint %}

***

## Usage Example

{% hint style="info" %}
**NOTE: Please refer to the prerequisite information shown** [**here**](https://docs.zingy.ai/app-editor/page-flow/references/prerequisite-for-data-examples) **before seeing the example.**&#x20;
{% endhint %}

The image below shows an example of **`Data Add Record`** the block.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FctzZsPFJVAZcVfzChoD6%2Fimage.png?alt=media&#x26;token=ab77bb6b-bdb6-4613-9b44-cf42cda4b835" alt=""><figcaption><p>Example for Data Add Record block</p></figcaption></figure>

Here is a summary of the above example:

* The [Event Action](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/event-action) block is used to handle a [click](https://docs.zingy.ai/app-editor/page-flow/event-action#event-names) event for a button.
* The **`Data Add Record`** block is used to add a new record into the *Customers* database table. The record is for the name *Jane Max* .
* The [Data Status](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-status) block is used to track the completion of the database add operation.
* Upon a successful completion, the [Show Information Popup](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/show-information-popup) block is used to display the [record identifier](https://docs.zingy.ai/data/database-tables#id-field) of the newly added record along with the value of the *FirstName* field.

The result for the above example is shown in the image below. The record identifier for the newly added record (*64f1018ab5ed96040cc633b3*) is displayed along with the value of the *FirstName* field.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FesWoTVQjmWte5tjPDVyW%2Fimage.png?alt=media&#x26;token=448030e7-71eb-4549-99a2-c10b8bc42689" alt="" width="563"><figcaption><p>Result of the above example for Data Add Record block</p></figcaption></figure></div>

The *Customers* database table now contains the following, with the record we added highlighted:

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F0UmjHrkgLSGE1OiG1P2f%2Fimage.png?alt=media&#x26;token=40dc83de-c4e5-4ad6-a549-e79e667c50a4" alt=""><figcaption><p>Database records after the above example completes</p></figcaption></figure>
