# Data Generator

The Data Generator lets you set up a field that can either copy data from somewhere else or create repeating data automatically. You can also decide if it should apply default values, run rules or calculations, and trigger updates or email alerts before saving.

| Module name for choosing the source bloc                         | Lets you specify a module if the source bloc is outside the current module. Leave blank to use blocs in the current module.                                  |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Select Source Bloc                                               | Choose the bloc where the data will be copied from.                                                                                                          |
| Only get data matching local fields                              | Allows you to filter which data gets copied, based on matching fields in the current (local) bloc.                                                           |
| Local Field to check                                             | The field in your current bloc used to match against source data.                                                                                            |
| Field to look up                                                 | The corresponding field in the source bloc that will be compared with the local field.                                                                       |
| Select Destination Bloc                                          | Choose the bloc where the data should be copied to.                                                                                                          |
| Map source to destination fields                                 | Define how fields from the source bloc should map to fields in the destination bloc.                                                                         |
| Source Field                                                     | A field in the source bloc whose value will be copied.                                                                                                       |
| Destination Field                                                | The field in the destination bloc that will receive the copied value.                                                                                        |
| What triggers the copying event                                  | Choose the condition or action that will start the data copying process (e.g., form submit, button click).                                                   |
| Apply Bloc Initialisation Actions                                | Runs the default values and initialisation phase on each generated record in the destination bloc.                                                           |
| Apply Field Actions (Parameters, Rules, Live Field Activity)     | Runs all field-level rules, calculations and actions on each generated record.                                                                               |
| Apply Pre Submit Data Features (Cross Bloc Updates, Mail Alerts) | Triggers cross-bloc updates and mail alerts as part of the generation process, just as they would fire on a normal form submission.                          |
| Button Text                                                      | The label shown on the button that triggers the data generation (e.g., "Generate Items", "Add Squad"). Only applies when the trigger is set to button click. |
| Ask User Confirmation                                            | When enabled, shows a confirmation popup before the data generation runs.                                                                                    |
| Confirmation Popup Text                                          | The message displayed in the confirmation popup if Ask User Confirmation is enabled.                                                                         |
| Fields to Refresh After Completion                               | Select which fields (e.g. a Results Box) should reload once the data generation has finished.                                                                |
| Trigger Actions After Copying                                    | When enabled, field actions will be run on the destination bloc after the data has been copied.                                                              |
|                                                                  |                                                                                                                                                              |


---

# 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/data-generator.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.
