# Cross-Bloc Data Manipulator

The Cross-Bloc Data Manipulator Component is for manipulating data in either external blocs or the same bloc that the component is created in. It is a powerful tool that allows you to add records, delete records, update records with certain values or apply mathematical formulas to records.

{% hint style="success" %}
This tool can be used for warehouse management, inventory and stock where the activity on one bloc may affect quantities or data on another.\
\
Other uses for this tool are activities such as mass updating data where certain values exist, or mass deleting (e.g. changing the status of multiple records).
{% endhint %}

{% hint style="success" %}
**Hint:** Don't forget, like all Blocworx fields and components, you can add as many as you like. This means you could set up various criteria and link several of these to different Blocs, where all changes take effect once you submit the form. For example, in an inventory system, if you were moving stock, you could delete from one bloc and add to another.
{% endhint %}

{% hint style="warning" %}
**Caution:** This tool has the ability to make large sudden changes to other data sets.
{% endhint %}

### Initial Parameters

| Parameter                                                                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type Module Name (optional)                                                                   | This can be used for accessing Blocs outside of the module you are currently in. You may leave blank if you want to access the the blocs in the current module.                                                                                                                                                                                                                                                                                                                                           |
| Select Bloc                                                                                   | Use this to choose the bloc whose data you wish to affect.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Select Data Manipulation Option                                                               | The action you wish to carry out with, add a record, delete a record, update records with values and multiple mathematical update options.                                                                                                                                                                                                                                                                                                                                                                |
| Choose when the action happens                                                                | Used to decide when the update itself should occur. Some people may want this to automatically happen after the form submits, others may want to manually control when this action occurs                                                                                                                                                                                                                                                                                                                 |
| Choose Local Field to decide number of records to be added (only for "Add New Record" option) | Allows you to choose a field in the bloc that will determine how many records to add. If not used this defaults to 1. So only one record will be added every time the record is triggered.                                                                                                                                                                                                                                                                                                                |
| Select Local and Remote Matching Fields for Updating (doesn't apply to "Delete record")       | Allows you to set the fields that will be updated. Here you match each local field with the remote field (in the bloc you have chosen).                                                                                                                                                                                                                                                                                                                                                                   |
| Select Local and Remote Matching Fields to Check Against (doesn't apply to "Add New Record")  | Allows you to set the fields that will be looked up. Here you match each local field with the remote field (in the bloc you have chosen).                                                                                                                                                                                                                                                                                                                                                                 |
| Add New Record if None Exists                                                                 | <p>A useful option when you are trying to update a record but the record does not exist. With this option turned on it will add the new record. Please note you have to select the local and remote matching fields for adding the new record.<br><br><img src="https://1186088597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSr2uF2m-DtSpCxknCK-887967055%2Fuploads%2FkUnKhGJacIsTdq8HTtnZ%2Fimage.png?alt=media&#x26;token=c3b9c8d5-428d-47e7-b0e2-6ba63533075c" alt=""></p> |
| Apply Bloc Initialisation Actions                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Apply Field Actions (Parameters, Rules, Live Field Activity)                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Apply Pre Submit Data Features (Cross Bloc Updates, Mail Alerts)                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |


---

# 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://manual.blocworx.com/blocworx-documentation/bloc-editor/fields-tools-and-charts/sub-blocs-tools-components/cross-bloc-data-updates.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.
