# Check Text Contents

## Overview

This operation checks if a particular value (such as a string, float, or integer) exists within a text. It acts as a conditional check, allowing you to perform additional operations based on whether the value exists.

## Syntax

```
the text is "{target}"
the object is "{value}"
if the object is in the text then
 {action}
```

## Data

The table below lists the names of the data elements in this operation and indicates which can be renamed in the syntax.

| Data Name  | Can Be Renamed |
| ---------- | -------------- |
| the text   | Yes            |
| the object | Yes            |

## Parameters

**Parameters** are placeholders for data. Refer to the table below for details on each parameter in this operation. In the syntax, replace parameters with your own values.

<table><thead><tr><th width="120.15234375">Parameter</th><th>Description</th><th>Examples</th><th>Required</th></tr></thead><tbody><tr><td><code>target</code></td><td>The target text in which the search is performed.</td><td><ul><li>Batch job completed.</li><li>Error code: 404</li><li>document.txt</li><li>The value of π (pi) is approximately 3.14.</li></ul></td><td>Yes</td></tr><tr><td><code>value</code></td><td>The value to search for (text, float, or integer).</td><td><ul><li>job completed</li><li>404</li><li>.txt</li><li>3.14</li></ul></td><td>Yes</td></tr><tr><td><code>action</code></td><td>An operation that occurs if <code>value</code> is present in <code>target</code>.</td><td><ul><li>say "The format is valid."</li></ul></td><td>Yes</td></tr></tbody></table>

## Examples

### 1. Validating a File Extension

{% tabs %}
{% tab title="Automation" %}

```
the file name is "document.txt"
the extension is ".txt"
if the extension is in the file name then
  say "The format is valid."
```

{% endtab %}

{% tab title="Results" %}

```
The format is valid.
```

{% endtab %}
{% endtabs %}

### 2. Check for a Specific Error Code

{% tabs %}
{% tab title="Automation" %}

```
the status log is "Batch job completed with errors. Error code: 404."
the error code is "404"
if the error code is in the status log then
  say "Cannot proceed."
```

{% endtab %}

{% tab title="Results" %}

```
Cannot proceed.
```

{% endtab %}
{% endtabs %}


---

# 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.kognitos.com/legacy/legacy-experience/automation-areas/text/boolean-checks/check-text-contents.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.
