# Identify Elements in a Text

### Overview

This procedure searches for and extracts specific information from text strings. It can handle both singular and plural forms, work with multiple choice options, and answer questions about the content. The search is powered by AI to understand context and meaning beyond simple text matching.

{% hint style="warning" %}
Make sure to add the **Document Processing Book** to your agent before using this automation procedure.
{% endhint %}

### Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

<details>

<summary><code>find {the item} in the text</code></summary>

#### What does it do?

Begins the search for the specified thing within the target string.

#### Where does it go?

This phrase should be written on a **new line**.

#### Is it required?

✅ Yes — This phrase is **required**.

#### Does it require data?

✅ Yes — Replace **the item** with the item(s) to locate within the text, which can be singular or plural. This should be descriptive of the item(s) to find. Replace **the text** with the text to search in, which can be a sentence, a paragraph, or a reference to a previously defined value in the automation.

</details>

<details>

<summary><code>the options are "option1", "option2", "option3"...</code></summary>

#### What does it do?

Provides a list of possible options to choose from.

#### Where does it go?

Indented under `find {the item} in the text where`.

#### Is it required?

❌ No — This phrase is **optional**.

#### Does it require data?

✅ Yes — Replace **option1**, **option2**, **option3**, etc. with the available choices.

#### Example

```
the options are "Apple", "Banana", "Cherry"
```

</details>

<details>

<summary><code>the question is "your-question"</code></summary>

#### What does it do?

Specifies a question to answer based on the text content.

#### Where does it go?

Indented under `find {the item} in the text where`.

#### Is it required?

❌ No — This phrase is **optional**.

#### Does it require data?

✅ Yes — Replace **your-question** with the question you want answered.

#### Example

```
the question is "What is the sender's email address?"
```

</details>

<details>

<summary><code>the response format is "response-format"</code></summary>

#### What does it do?

Specifies the desired format of the response.

#### Where does it go?

Indented under `find {the item} in the text where`.

#### Is it required?

❌ No — This phrase is **optional**.

#### Does it require data?

✅ Yes — Replace **response-format** with one of the following: **string**, **text**, **date**, **table**, **list of texts**, **list of numbers**, **list of dates**, **list of records**, **structured data**, **json**. The default is **string**.

#### Example

```
the response format is "json"
```

</details>

### Examples

#### 1. Simple Find

In this example, we are finding the word "fox" in the sentence.

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

```
the sentence is "The quick brown fox jumps over the lazy dog"
find the animal in the sentence
```

{% endtab %}

{% tab title="Results" %}
**the animal**: "fox"
{% endtab %}
{% endtabs %}

#### 2. Find People in a Sentence

Here, the people John, Sarah, and Tim are looked for in the sentence.

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

```
find the people in "The project was completed by John, Sarah, and Tim."
```

{% endtab %}

{% tab title="Results" %}
**the people**: "John", "Sarah", "Tim"
{% endtab %}
{% endtabs %}

#### 3. Find with Options

In this example, a color is looked for in the sentence using the available options.

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

```
the text is "Cars need to stop at a red light."
find the color in the text where
    the options are "red", "yellow", "green"
```

{% endtab %}

{% tab title="Results" %}
**the color**: "red"
{% endtab %}
{% endtabs %}

#### 4. Find Multiple Things

In this example, the sweet spots (Java House and Café Mocha) are looked for in the memo.

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

```
the memo is "Reminder: Don't forget to check out the new cafés I visited this weekend: Java House and Café Mocha."
find the sweet spots in the memo
```

{% endtab %}

{% tab title="Results" %}
**the sweet spots**: "Java House", "Café Mocha"
{% endtab %}
{% endtabs %}
