# Replace None

This function block provides a simple fallback mechanism: when the primary input is missing (`None`), it outputs a user-provided replacement value so downstream blocks continue to receive valid data.

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

* `Input Data` (Generic) — Primary data to be checked for presence.
* `New Data` (Generic) — Replacement data to use when the primary input is `None`.

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

* `Replaced Data` (Generic) — The resulting data: either the original `Input Data` if present, or `New Data` when the input is `None`.

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

This block has no interactive controls.

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

* Minimal, reliable fallback for missing values to prevent breaks in a flow.
* Generic data type support — works with images, numbers, text, lists, or other data types.
* Lightweight and deterministic behavior — always passes either the original or the replacement value.

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

1. Connect the source you want to guard to `Input Data`.
2. Provide a default or fallback value to `New Data`. This can be a static value, a previously stored value, or a placeholder image/number/text.
3. Read the result from `Replaced Data` and continue the pipeline as usual.

Example uses: provide a placeholder image when a camera feed briefly fails, supply a default number for calculations, or pass a backup string when a network response is missing.

## ⚙️ How it runs <a href="#evaluation" id="evaluation"></a>

When the flow runs, this block checks whether `Input Data` is present. If it is present, that value is forwarded. If it is `None`, the block forwards the value supplied to `New Data`. If both are `None`, the output will be `None` (so ensure a meaningful fallback is provided when needed).

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

* Combine with `Is None` to create branching logic (for example, trigger an alert only when the original input is missing).
* Use with `Data Memory` to freeze and re-use the last valid value as the `New Data` fallback.
* When dealing with image streams (e.g., from `Camera USB` or `Stream Reader`), feed a representative static image into `New Data` so viewers like `Show Image` always have something meaningful to display.
* Pair with `Debug Input` or `Data to JSON` to log when fallbacks are used, helping you monitor data quality over time.
* For saving fallback events or results, link `Replaced Data` to `CSV Export` or `Image Logger` depending on data type.

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

* If you still see `None` at the output, confirm a non-`None` value is provided to either `Input Data` or `New Data`.
* For image pipelines: if the fallback appears but looks wrong, check the format (color channels, size) of the `New Data` to match downstream expectations.


---

# 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/blocks-reference/data-logic/data-operations/replace-none.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.
