# Data Update Record with ID

{% 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 Update Record with ID`** is a [regular block](https://docs.zingy.ai/app-editor/block-anatomy#regular-block) that initiates the modification/update of a [record](https://docs.zingy.ai/data/database-tables#table-records) in 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%2FBX3ap0eGcLwcgrIaqNaa%2Fimage.png?alt=media&#x26;token=98298a34-3f41-4310-bfdd-82bdb5306da4" alt="" width="211"><figcaption><p>Data Update Record with ID 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 ID*: [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 identifier for the record being modified/updated.
* *Set fields to*: [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.&#x20;

{% hint style="success" %}
**NOTE**:&#x20;

* This block initiates the database record update operation, 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;For the *Set fields to* [value parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters), you only have to provide values for the fields you want to modify/update and can leave the other fields unassigned.
  {% 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 Update Record with ID`** the block.&#x20;

In this example we will be modifying the *Notes* field for the record with identifier *64f1018ab5ed96040cc633b3* . As this is the same record we added in the example for the [Data Add Record](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-add-record) block, please take a moment to go over that [example](https://docs.zingy.ai/app-editor/page-flow/data-add-record#usage-example).

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FBSYwVxHNuQFl9H6wCGxt%2Fimage.png?alt=media&#x26;token=37bceae3-e7d7-42cb-8e85-7c6c9f49c0cf" alt=""><figcaption><p>Example of Data Update Record with ID</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 Update Record with ID`** block is used to modify/update the record with identifier *64f1018ab5ed96040cc633b3* in the *Customers* database table. The record is for the name *Jane Max* .
* Only the *Notes* field has a value specified (*Modified Notes*). All other fields do not have any value assigned. This will ensure that only the *Notes* field is modified.
* 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 update 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 a message that the operation is complete.

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

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FS9aJzbuSUUns2qcHuF73%2Fimage.png?alt=media&#x26;token=c4dee7a1-fe14-4339-9506-af55e44cd878" alt=""><figcaption><p>Database records after the above example completes</p></figcaption></figure>
