> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/data-logic/referencing/data-write-global.md).

# Data Write Global

This function block stores incoming data into a global data storage that is accessible across the whole scenario. Use it to share values, images or structured data between different parts of your system or to create a simple global state.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Generic` Input socket that accepts any data to be written into the global storage.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

This function block does not provide outputs.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Data Key` — Text field where you type the key name used to store the data in the global storage. The control provides suggestions based on existing global keys so you can reuse or overwrite them.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

* When the block runs, it reads the value provided to the `Generic` input and the text in `Data Key`.
* If an input value is present, the block writes that value into the global storage under the chosen `Data Key`.
* The global storage is shared across the whole scenario. Because of this global visibility, using this block can create implicit loops or cross-dependencies; the block does not guarantee strict data-flow ordering.

## 🎯 Features <a href="#features" id="features"></a>

* Persistent, scenario-wide data sharing for values, images or complex data.
* Key autocomplete helps avoid typing errors and encourages reusing keys.
* Simple way to pass information between distant parts of a flow without direct connections.

## 📝 Usage instructions <a href="#usage" id="usage"></a>

1. Provide the value you want to store to the `Generic` input socket.
2. Type or select a name in the `Data Key` control to identify the stored item.
3. Run the scenario. The value will be available to any other block that reads from the global storage using the same key.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Retrieve the stored value later using the `Data Read Global` block.
* For short-lived or loop-local sharing, prefer `Data Write Local` and `Data Read Local` instead of global storage.
* To avoid writing empty values, combine with `Is None` or `Replace None` before writing.
* Add timestamps by combining with `Date-Time` or `Date-Time List` when you need logged values.
* For logging or export workflows, pair with `Data to JSON` and `CSV Export` to serialize and save data.
* For image data, consider using `Image Logger` or `Image Write` in addition to global storage to persist images to disk.
* Use `Logic Input` to gate when the write happens (write only on a trigger) and use `Debug Input` to inspect values during development.
* If you want to freeze a value that should not update every run, use `Data Memory` to control when updates happen.

## ⚠️ Cautions <a href="#cautions" id="cautions"></a>

* Global storage can create implicit dependencies. Avoid overusing global writes for frequently updated data in performance-sensitive or time-critical flows.
* Naming collisions may occur if multiple blocks use the same key unintentionally. Use consistent, descriptive keys and rely on autocomplete to reduce mistakes.
