# Data Read Local

This function block reads a value previously stored in the scenario's local storage and returns it for use by other blocks. It is useful for sharing data across steps or implementing simple loops where direct wiring is not possible.

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

This function block does not have any inputs.

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

`Generic` The value retrieved from the local storage for the provided key. If the key is not found, a warning is issued and a placeholder value is returned.

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

`Data Key` Enter a text key that identifies the data you want to read from local storage. Use the exact same key that was used when the value was written.

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

When the scenario runs, this block looks up the text key you entered in the scenario's local storage. If a matching entry exists, the stored value is retrieved and provided on the `Generic` output. If no entry exists for the key, the block issues a warning and returns a placeholder value so the flow can continue.

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

* Enter the exact storage key into the `Data Key` control.
* Place this block where you need to access the stored value.
* Combine with a block that writes the value beforehand so the key is populated.

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

* To write data that this block can read, use `Data Write Local` before this block in the scenario.
* For data that must be shared across multiple scenarios or globally, use `Data Read Global` and `Data Write Global`.
* Use `Data Memory` to freeze or hold important image or generic data so it can be read repeatedly without being overwritten.
* Combine with `Subsystem Loop`, `Subsystem In`, and `Subsystem Out` when implementing looped processing that requires temporary storage between iterations.
* Use `Is None` or `Replace None` after reading to handle missing values gracefully.
* Use `Debug Input` to log or inspect the retrieved value during development.
* To serialize or export multiple stored fields, consider `Data to JSON` and then export via `CSV Export` if needed.
* When the stored value is a list or batch, use `Get Element`, `Debatch`, or `Batch Concatenation` to manage individual elements.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If you receive a warning that the key could not be found:
  * Verify the spelling and casing of the `Data Key` is identical to the key used when writing.
  * Ensure the block that writes the key was executed earlier in the scenario.
* If the retrieved value is not the expected type:
  * Confirm what was stored (e.g., number, text, image, list) and use appropriate downstream blocks such as `Parse Data Dictionary`, `Get Element`, or type-conversion helpers to adapt it.


---

# 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://docs.augelab.com/function-blocks/data-logic/referencing/data-read-local.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.
