# Retrieve Item

### Overview

This procedure retrieves a specific item from a department box *(a storage unit within an agent)*. If the item does not exist, this procedure offers the option to create a new record with an empty value or to skip the retrieval.

### Syntax

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

<details>

<summary><code>x is a department box</code></summary>

#### What does it do?

Specifies a department box.

#### 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 **x** with the department box's name *(in plural form)*.

#### Example

```
Movies is a department box
```

</details>

<details>

<summary><code>the department box's engine is x</code></summary>

#### What does it do?

Specifies the engine used for the department box. Options include: **Amazon S3** for large or unstructured data, **Amazon DynamoDB** for fast key-value lookups, and **Amazon OpenSearch** for advanced search and filtering capabilities.

#### Where does it go?

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

#### Is it required?

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

#### Does it require data?

✅ Yes — Replace **x** with one of the following values: `s3`, `dynamodb`, `opensearch`. The default is `s3`.

#### Example

```
the department box's engine is "dynamodb"
```

</details>

<details>

<summary><code>export x</code></summary>

#### What does it do?

Exports the department box to get the data.

#### 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 **x** with the department box's name *(in plural form)*.

#### Example

```
export Movies
```

</details>

<details>

<summary><code>retrieve the item from {the department box} whose key is like "x"</code></summary>

#### What does it do?

Specifies a record to retrieve from a department box with a specific key.

#### 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 department box** with the name of the department box. Replace **x** with a text value or reference that specifies the key.

#### Example

```
retrieve the item from Movies whose key is like "The Matrix"
```

</details>

<details>

<summary><code>retrieve "x" from {the department box}</code></summary>

#### What does it do?

Retrieves the actual value at the key from the department box.

#### 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 **x** with the key. Replace **the department box** with the name of the department box.

#### Example

```
retrieve "The Matrix" from Movies
```

</details>

### Examples

#### 1. Example 1

This command retrieves the item with the key "announcement" from the HR department box.

```
Movies is a department box
export Movies
retrieve the item from HR whose key is like "The Matrix"
retrieve "The Matrix" from Movies
```

#### 2. Example 2

```
employees is a department box
the department box's engine is "s3"
export employees
retrieve the item from employees whose key is like "ID:123456"
retrieve "ID:123456" from employees
```
