# Find Substring

This function block searches a shorter text inside a longer text and returns a boolean result indicating whether the shorter text exists in the longer one. It is ideal for simple text checks, triggers and conditional logic in your scenarios.

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

`Main Text` The text to be searched.

`Sub Text` The substring to look for inside the main text.

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

`Result` Boolean value: TRUE when the substring is found in the main text, otherwise FALSE.

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

`No Controls` This block has no interactive widgets. It operates only using its input sockets.

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

* Fast boolean check to verify presence of a substring in a text.
* Safe behavior when inputs are empty: returns FALSE if required text is missing.
* Minimal configuration — just provide the texts and read the boolean output.

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

1. Provide the longer text into the `Main Text` input socket. You can use a `String Input` block or any other block that outputs text.
2. Provide the substring to search into the `Sub Text` input socket.
3. Read the boolean value from the `Result` output socket to decide downstream actions (for example, trigger logging or alerts).

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When evaluated, this block checks whether the `Sub Text` exists within the `Main Text` and outputs the check result via the `Result` socket.

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

* To avoid case-sensitivity issues, combine with `String Operations` to convert both texts to a common case before checking.
* Use `String Merge` to build dynamic messages (for example combine variable parts into a single `Main Text`).
* Use `Is None` or `Replace None` before this block to ensure empty inputs are handled predictably.
* Feed the boolean `Result` into a `Logic Input` or other logic blocks (like `And`, `Or`) to drive conditional flows.
* Use `Debug Input` or `Data to JSON` to log matches during development and troubleshooting.
* To store or export match events, combine the boolean output with `CSV Export` or `Image Logger` workflows depending on your data needs.

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

* No matches but expected: check for case differences or leading/trailing spaces. Normalize text with `String Operations` (e.g., lowercasing, trimming) before feeding this block.
* Always FALSE: ensure both `Main Text` and `Sub Text` sockets are receiving valid text. Use `Debug Input` to inspect upstream values.
* Unexpected TRUE matches: verify the exact substring provided; small typos or partial words may still produce a match depending on the content.


---

# 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/data-operations/find-substring.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.
